I'd like to have a radio button in my shiny app that changes the table type -- one using DT::renderDataTable and one using renderTable. That requires different input and output types. I tried this in my server
output$contents <- renderUI({
if(input$myfilter == "interactive"){
DT::renderDataTable({
datatable(mydata())
})
} else {
renderTable({
mydata()
})
}
})
and this in my ui
uiOutput("contents")
but get an error that object of type 'closure' is not subsettable. What am I missing? Thanks.