UE_house_prices_wizualizacja/test_checkboxes.R
2023-06-14 11:28:02 +02:00

28 lines
676 B
R

## Only run examples in interactive R sessions
if (interactive()) {
# Frontend
ui <- fluidPage(
# Checkboxes
checkboxGroupInput("countries", "Choose countries:",
choiceNames = unique(merged_df$geo),
choiceValues = unique(merged_df$geo)
),
# list of chosen
textOutput("txt")
)
# Backend
server <- function(input, output, session) {
# Printer
output$txt <- renderText({
chosen_countries <- paste(input$countries, collapse = ", ")
paste("You chose", chosen_countries)
})
}
shinyApp(ui, server)
}