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("<div class='control-group shiny-input-radiogroup shiny-bound-input' id='radio",1:2,"'>
    <label class='control-label' for=='radio",1:2,"'>Individual</label>
    <label class='radio'>
    <input id=='radio1",1:2,"' name='radio",1:2,"' type='radio' value='cyl'>
    <span>Cylinders</span>
    </label>
    <label class='radio'>
    <input id=='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)"