title: How to plot a graph in shiny app after a file has been uploaded
body: <p>I have a really simple csv file.</p>
  
  <pre><code>&gt; head(data)
    X Y
  1 1 1
  2 2 2
  3 3 4
  4 4 8
  </code></pre>
  
  <p>I am trying to create a shinny app dashboard that plots this data after the file has been uploaded.</p>
  
  <p>This is what I have so far.</p>
  
  <pre><code>library(shinydashboard)
  
  
  ui &lt;- dashboardPage(
    dashboardHeader(title = "Basic dashboard"),
    dashboardSidebar(
      fileInput("file1", "Choose CSV File",
                multiple = TRUE,
                accept = c("text/csv",
                           "text/comma-separated-values,text/plain",
                           ".csv")),
      sidebarMenu(
        menuItem("Dashboard", tabName = "dashboard", icon = icon("dashboard")),
        menuItem("Widgets", tabName = "widgets", icon = icon("th"))
      )
    ),
    dashboardBody(
      tabItems(
        # First tab content
        tabItem(tabName = "dashboard",
                fluidRow(
                  box(plotOutput("plot1", height = 250))
                )
        ),
  
        # Second tab content
        tabItem(tabName = "widgets",
                h2("Widgets tab content")
        )
      )
    )
  )
  
  server &lt;- function(input, output) {
    options(shiny.maxRequestSize=100*1024^2)
  
    inFile &lt;- input$file1
    data &lt;- read.csv(inFile$datapath, header = input$header, stringsAsFactors = FALSE)
  
    output$plot1 &lt;- renderPlot({
      plot(data)
    })
  }
  
  shinyApp(ui, server)
  </code></pre>
  
  <p>But I am getting an error</p>
  
  <pre><code>Error in .getReactiveEnvironment()$currentContext() : 
    Operation not allowed without an active reactive context. (You tried to do something that can only be done from inside a reactive expression or observer.)
  </code></pre>
  
  <p>From what I have read the read file needs to be reactive, and then that need to be called by the plot, but I am not familiar with the reactive concepts, any help will be appreciated.</p>