I have a checkboxGroupInput in my Shiny app with the following code :
checkboxGroupInput("sexe", "Sexe:",
c("Masculin" = "mas","Féminin" = "fem"))
My question is how to have them checked when first loaded?
knowing that I've tried selected= c but didn't work
use selected = c("mas","fem")
For example
library(shiny)
library(shinydashboard)
ui <- dashboardPage(
dashboardHeader(),
dashboardSidebar(),
dashboardBody( checkboxGroupInput("sexe","Sexe:",
choices = c("Masculin" = "mas", "Femenin" = "fem"),
selected = c("mas","fem")))
)
server <- function(input, output){
}
shinyApp(ui, server)

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With