```
for(i in 1:length(levels(myfactor))){
output$DATA_i <- reactive({
data.frame(...)
})
}
for(i in 1:length(levels(myfactor))){
id <- levels(myfactor)[i]
output$PANEL_i <- renderUI({
tabPanel(paste0("tab_","id"),
tableOutput(deparse(substitute(DATA_i)))
})
}
``` --
You received this message because you are subscribed to the Google Groups "Shiny - Web Framework for R" group.
To unsubscribe from this group and stop receiving emails from it, send an email to shiny-discus...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
```
withTags(div(class='row-fluid',
div(class='span4', numericInput("lwr", "Lower limit", value=NA)),
div(class='span4', numericInput("upr", "Upper limit", value=NA))
))
```
```
withTags(div(class='row-fluid',
div(class='span4', numericInput(lwr, "Lower limit", value=NA)),
div(class='span4', numericInput(upr, "Upper limit", value=NA))
))
```
Error in as.character(x) :
cannot coerce type 'closure' to vector of type 'character'
```
tags$div(class='row-fluid',
div(class='span4', numericInput(lwr, "Lower limit", value=NA)),
div(class='span4', numericInput(upr, "Upper limit", value=NA))
)
```
Error in if (I == i) output[[nodes[i]]] <- renderTable({ :
argument is of length zero
Thanks very much for your help,library(shiny)
runApp(list(
ui = pageWithSidebar(
headerPanel('Dynamic Tabs'),
sidebarPanel(
numericInput("nTabs", 'No. of Tabs', 5)
),
mainPanel(
uiOutput('mytabs')
)
),
server = function(input, output, session){
output$mytabs = renderUI({
nTabs = input$nTabs
myTabs = lapply(paste('Tab', 1: nTabs), tabPanel)
do.call(tabsetPanel, myTabs)
})
}
))Thanks for your suggestions.
I tried the non-dynamic first tab option previously and that did not resolve the issue.
Unfortunately taking the counter out of the render body did not resolve the issue either (still the same table in all tabs).
Including I <- input$tab0 and if(I==i) produces the same error as I got before:
Error in if (I == i) { : argument is of length zero
This is precisely the role of submitButton(). You may try actionButton() instead.
--
You received this message because you are subscribed to a topic in the Google Groups "Shiny - Web Framework for R" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/shiny-discuss/-yxa4WFNTcA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to shiny-discus...@googlegroups.com.