title: R Shiny Tabsets simultaneous processing
body: <p>I have a R <code>Shiny</code> app, which calculates several statistics in different tabsets. As the calculations are quite computation intensive, I use <code>submitButton</code> to prevent reactivity. My problem is now that each calculation (all in different tabsets) are writing outputs to a folder and I want <code>Shiny</code> to write an output for all tabsets when initializing. Unfortunately, <code>Shiny</code> only creates an output for the tabset, that is active when initializing. Is there a way to tell <code>Shiny</code>, that it should calculate/render outputs for every tab when initializing? </p>
  
  <p>Here is a modified example from the <code>Shiny</code>[Tutorial]:(<a href="http://www.http://rstudio.github.io/shiny/tutorial/#more-widgets/" rel="nofollow">http://www.http://rstudio.github.io/shiny/tutorial/#more-widgets/</a>)</p>
  
  <p>ui.R:</p>
  
  <pre><code>library(shiny)
  
  # Define UI for dataset viewer application
  shinyUI(pageWithSidebar(
  
    # Application title.
    headerPanel("More Widgets"),
  
    # Sidebar with controls to select a dataset and specify the number
    # of observations to view. The helpText function is also used to 
    # include clarifying text. Most notably, the inclusion of a 
    # submitButton defers the rendering of output until the user 
    # explicitly clicks the button (rather than doing it immediately
    # when inputs change). This is useful if the computations required
    # to render output are inordinately time-consuming.
    sidebarPanel(
      selectInput("dataset", "Choose a dataset:", 
                  choices = c("rock", "pressure", "cars")),
  
      numericInput("obs", "Number of observations to view:", 10),
  
      helpText("Note: while the data view will show only the specified",
               "number of observations, the summary will still be based",
               "on the full dataset."),
  
      submitButton("Update View")
    ),
  
    # Show a summary of the dataset and an HTML table with the requested
    # number of observations. Note the use of the h4 function to provide
    # an additional header above each output section.
    mainPanel(
      tabsetPanel(
        tabPanel("Summary", verbatimTextOutput("summary")),
        tabPanel("Table", tableOutput("view"))
  
      )
    )
  ))
  </code></pre>
  
  <p>server.R:</p>
  
  <pre><code>library(shiny)
  library(datasets)
  
  # Define server logic required to summarize and view the selected dataset
  shinyServer(function(input, output) {
  
    # Return the requested dataset
    datasetInput &lt;- reactive({
      switch(input$dataset,
             "rock" = rock,
             "pressure" = pressure,
             "cars" = cars)
    })
  
    # Generate a summary of the dataset
    output$summary &lt;- renderPrint({
      dataset &lt;- datasetInput()
  
      capture.output(summary(dataset),file="summary.txt")
  
    })
  
    # Show the first "n" observations
    output$view &lt;- renderTable({
      a&lt;-head(datasetInput(), n = input$obs)
  
      capture.output(a,file="table.txt")
  
    })
  })
  </code></pre>