title: How do I build a reactive dataframe in R / Shiny?
body: <p>I want to use a reactive dataframe to show multiple plots and graphs. I have a dataset that I would like to be able to filter on. Ones I have found the right filter settings, I would like to show the data on a number of different plots – that will update, if the filter settings are changed.</p>
  
  <p>This might explain, what I’m trying to do:</p>
  
  <p>UI:</p>
  
  <pre><code>fluidPage(
    sidebarLayout(
      sidebarPanel(
  
        checkboxGroupInput("checkGroups", 
                           label = "Include", choices = list("1 star" = 1, "2 star" = 2,
                                                             "3 star" = 3, "4 star" = 4,
                                                             "5 star" = 5),
                           selected = list(1, 2, 3, 4, 5)),
  
        checkboxInput("checkbox", "Include Replies"),
  
        actionButton("Button", "Update")
  
      ),
      mainPanel(
  
        showOutput("plot", "nvd3"),
  
        showOutput("pieplot", "nvd3")
  
      )
    )
  )
  </code></pre>
  
  <p>SERVER:</p>
  
  <pre><code>rating &lt;- c(2, 3, 5, 4, 1, 5, 3, 1, 4)
  date_time &lt;- c("2015-05-14", "2015-05-07", "2015-05-06", "2015-04-11", "2015-01-07", "2014-12-06", "2014-04-11", "2014-01-07", "2013-12-06")
  repliesOnly &lt;- c(TRUE, FALSE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, TRUE)
  data &lt;- data.frame(rating, date_time, repliesOnly)
  
  function(input, output, session) {
  
    load("data.Rdata")
  
    newdata &lt;- reactive({
  
      filter_data &lt;- data
  
      filter_data &lt;- filter_data %&gt;% filter(rating %in% input$checkGroups)
  
      filter_data &lt;- filter_data %&gt;% filter(repliesOnly %in% input$checkbox)
  
      return(filter_data)
  
    })
  
    output$plot &lt;- renderChart({
  
      plot &lt;- nPlot(rating ~ date_time, data = newdata, 
                    type = "multiBarHorizontalChart", dom = 'plot')
      return(plot)
  
    })
  
    output$pieplot &lt;- renderChart({
  
      pieplot &lt;- nPlot(rating ~ date_time, data = newdata, 
                    type = "pieChart", dom = 'pieplot')
      return(pieplot)
  
    })
  
  }
  </code></pre>
  
  <p>Can it be done? Of course I can just include the filter for each graph-output, but my dataset is rather big and my filter is quite complex, so if it should calculate it for each graph it takes forever.</p>
  
  <p>All help is deeply appreciated!</p>