brilliant selectInput widget requires a named list of options in this format:
choices = list( "mpg" = 1, "cyl" = 2, "disp" = 3, "hp" = 4
data frames going to my brilliant application will not have the same variable names, so I would like to generate a list of names on the fly.
here is an attempt:
data(mtcars) choices = data.frame( var = names(mtcars), num = 1:length(names(mtcars)) ) > head(choices) var num mylist 1 mpg 1 "mpg" = 1 2 cyl 2 "cyl" = 2 3 disp 3 "disp" = 3 4 hp 4 "hp" = 4 5 drat 5 "drat" = 5 6 wt 6 "wt" = 6 paste(choices$mylist, collapse = ",")
this looks close, but it does not work:
... box( selectInput( "select", label = h3("Select box"), choices = list( paste(choices$mylist, collapse = ",") ) ) ...

how can i do this work?
source share