[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
Post a Comment