Can I have tab panels inside tab panel?

...


I am unable to fetch data from server.R to the plots in my sub tabpanels. But if I run the app excluding the main tab panels (Carbon di oxide,Temperature, and rainfall) with only sub tab panels of plots, I am able to fetch data from server.R

Can you share the ui.R and server.R code? It's difficult to tell what is causing the behavior without it.

Here is a simple example of nested tabsetPanels that works for me.

library(shiny)

ui <- fluidPage(
   
   titlePanel("Mock App"),
   
   tabsetPanel(
     tabPanel("Chemistry",
              tabsetPanel(
                tabPanel("First",
                         fluidRow(
                                  column(width = 6,
                                        plotOutput("Plot1", height = "350px") 
                                  )
                         )
                ),
                tabPanel("Second",
                         fluidRow(
                                  column(width = 6,
                                         plotOutput("Plot2", height = "350px") 
                                  ) 
                         )
                )
              ) #Close inner tabsetPanel
     ),
     tabPanel("Plasma",
              fluidRow(
                       column(width = 12,
                              h1("HI!")
                       )
              )
     )
  ) #Close outer tabsetPanel
) #Close FluidPage

server <- function(input, output) {
   
   output$Plot1 <- renderPlot({
      plot(seq(0,10), seq(100, 110), col = "red")
   })
   output$Plot2 <- renderPlot({
     plot(seq(0,10), seq(0, 10)^2, type = "b")
   })
}

# Run the application 
shinyApp(ui = ui, server = server)

This topic was automatically closed 54 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.