UE_house_prices_wizualizacja/test_checkboxes.R

28 lines
676 B
R
Raw Normal View History

2023-06-14 11:28:02 +02:00
## 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)
}