In here, I deliberately set names(male) = " male" and names(female) = " female" to indent and differentiate them from "sex"; however, this does not work once shiny runs. Is there a way that I can fix this?
For a reproducible example, see below where 'Male' and 'Female' should be displayed with indents.
shinyApp(
ui = fluidPage(
selectInput("state", "Choose a state:",
list(`categorical` = c("Sex"= "Sex", " Male" = "Male", " Female" = "Female"))
),
textOutput("result")
),
server = function(input, output) {
output$result <- renderText({
paste("You chose", input$state)
})
}
)