Skip to content Skip to sidebar Skip to footer

R Shiny: How To Embed Sliderinputs/selectinputs And Radiobuttons In A Data Frame ? (error: Cannot Coerce Class ""shiny.tag"" To A Data.frame)

I need to embed different types of Inputs in a matrix. It works fine for textInput() and numericInput(), but I can't find a way for selectInput(), sliderInput() and radioButton().

Solution 1:

I've found the solution. For radioButtons for ex, the code would be:

paste0("<divclass='control-group shiny-input-radiogroup shiny-bound-input'id='radio",1:2,"'><labelclass='control-label'for=='radio",1:2,"'>Individual</label><labelclass='radio'><inputid=='radio1",1:2,"'name='radio",1:2,"'type='radio'value='cyl'><span>Cylinders</span></label><labelclass='radio'><inputid=='radio2",1:2,"'name='radio",1:2,"'type='radio'value='am'><span>Transmission</span></label></div>")

It is obtainable by right-clicking on a webpage with some radioButtons and selecting 'Inspect element'.

Hope this will help others...

Post a Comment for "R Shiny: How To Embed Sliderinputs/selectinputs And Radiobuttons In A Data Frame ? (error: Cannot Coerce Class ""shiny.tag"" To A Data.frame)"