title: Global assignment within a reactive expression in R Shiny?
body: <p>suppose I have a data object that is uploaded by the user:</p>
  
  <pre><code>  data &lt;- reactive({
      inFile &lt;- input$file
      if (is.null(inFile)) return(NULL)
      data &lt;- read.csv(inFile$datapath)
      return(data)
    })
  </code></pre>
  
  <p>And suppose I want to delete columns in the dataset. I want to set it to global assignment so that I can run the UI multiple times and have each effect saved in the object.</p>
  
  <pre><code>dataset &lt;- reactive({
      file1 &lt;- data()
      file1[,input$deletecols] &lt;&lt;- NULL
      return(file1)
     }}
  })
  </code></pre>
  
  <p>However, when I run this, I get the error:</p>
  
  <blockquote>
    <p>invalid (NULL) left side of assignment</p>
  </blockquote>
  
  <p>What's causing this error? and how can I achieve this effect if global assignment doesn't work? </p>
  
  <p>Thanks very much.</p>