I have the following code in server.R, I am getting the error shown below. I have seen other examples which are working fine, I don't know why this is not working?
output$mytabs = renderUI({
if(some_condition)
myTabs = c(tabPanel('Title 1', h4("Tab 1"), htmlOutput("tab_data_1")),
tabPanel("Title 2",h4("Tab 2"), verbatimTextOutput("tab_data_2")))
if(some_other_condition)
myTabs = c(tabPanel('Title 3', h4("Tab 4"), htmlOutput("tab_data_3")),
tabPanel("Title 2",h4("Tab 2"), verbatimTextOutput("tab_data_2")))
do.call(tabsetPanel, myTabs)
# I also tried
# do.call(tabsetPanel, c("tabpanel", myTabs))
})
Error in `*tmp*`$attribs : $ operator is invalid for atomic vectors