How to extract element name, not value, from a list in R Shiny selectInput()?
问题 I would like to extract the element name, and not the specific value, from a list used for the choices argument in selectInput() from R Shiny. The selectInput function looks like this: # ... selectInput("xvar", "What is the predictor variable?", choices = list("MPG" = "mpg", "Cylinders" = "cyl", "Engine Displacement" = "disp", "Horse Power" = "hp", "Gears" = "gear"), # ... In my server.R code I would like to use, for example, "Cylinders" and not "cyl" as an axis label. For example (using