multiple outputs in a tabPanel?

5,123 views
Skip to first unread message

Cyndy Hart

unread,
Jul 17, 2013, 2:59:20 PM7/17/13
to shiny-...@googlegroups.com
Quoting the Shiny tutorial example of a ui.R example showing tabbed panels,

 
  mainPanel(
    tabsetPanel(
      tabPanel("Plot", plotOutput("plot")),
      tabPanel("Summary", verbatimTextOutput("summary")),
      tabPanel("Table", tableOutput("contents"))
    )

If I wanted to, say, have both the plot and the summary to display on the Polt tab together, how - can I - do I do that?  I tried some of the obvious things,
(like including verbatimTextOutput("summary") within the parenthesis to tablPanel("Plot") to no avail. 

?

Mike C

unread,
Jul 17, 2013, 3:09:22 PM7/17/13
to shiny-...@googlegroups.com
  mainPanel(
    tabsetPanel(
      tabPanel("Summary and Plot",
        verbatimTextOutput("summary"),
        plotOutput("plot")),       
      tabPanel("Table",
        tableOutput("contents"))
    )

this should work

Cyndy Hart

unread,
Jul 17, 2013, 3:16:48 PM7/17/13
to shiny-...@googlegroups.com
AH; I see.  Heaven help me if I try to use 'summary' twice.  ie, I had tried to add it to the Plot tab while retaining a summary tab, and that broke everything.

Why???? 

Mike C

unread,
Jul 17, 2013, 3:30:21 PM7/17/13
to shiny-...@googlegroups.com
yeah this wouldn't work:
  mainPanel(
    tabsetPanel(
      tabPanel("Plot", plotOutput("plot"), verbatimTextOutput("summary")),

      tabPanel("Summary", verbatimTextOutput("summary")),
      tabPanel("Table", tableOutput("contents"))
    )

While in this instance it may seem relatively harmless, I have to assume there is something behind the scenes that doesn't like being pushed out multiple places.
Reply all
Reply to author
Forward
0 new messages