Is there a simple method for incorporating superscripts/subscripts in shiny selectInput dropdown labels? This seems trivial but I can't find any good posts on it.
Here's an example of what I'm referring to:
# basic example
shinyApp(
ui = fluidPage(
selectInput("variable", "Variable:",
c("Cylinders" = "cyl",
"Transmission" = "am",
"Gears" = "gear",
"Miles gallon<sup>-1</sup>" = "mpg")),
tableOutput("data")
),
server = function(input, output) {
output$data <- renderTable({
mtcars[, c("wt", input$variable), drop = FALSE]
}, rownames = TRUE)
}
)
# demoing group support in the `choices` arg
shinyApp(
ui = fluidPage(
selectInput("state", "Choose a state:",
list(`East Coast` = list("NY", "NJ", "CT"),
`West Coast` = list("WA", "OR", "CA"),
`Midwest` = list("MN", "WI", "IA"))
),
textOutput("result")
),
server = function(input, output) {
output$result <- renderText({
paste("You chose", input$state)
})
}
)
Thanks!!