[r][shiny] how to render ui from a string? -


i have ui component stored in data frame or vector character.

chr <- "fluidrow( numericinput(inputid='a'), numericinput(inputid='b') ) "   

i want render character shiny ui. tried:

server.r

shinyserver(function(input, output, session) {     output$ui <- renderui({          eval(parse(text=chr))     })  }) 

ui.r

shinyui(fluidpage(     uioutput("ui")     ) ) 

first of all, cool idea. code's problem not in eval parse method, in numeric input arguments. missing value , label input.

try:

server.r

chr <- "numericinput(inputid='a', value = 1, label = 1)"   shinyserver(function(input, output, session) {   output$ui <- renderui({        eval(parse(text=chr))   })  }) 

ui.r

shinyui(fluidpage(   uioutput("ui") ) ) 

Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -