title: Error in eval(predvars, data, env) : invalid 'envir' argument of type 'character'
body: <p>I am newbie to R and started doing Linear Regression in RStudio with a very simple code like the following:</p>
  
  <pre><code>dataset = load("C:\\pathToRDA\\swiss.RDA")
  
  simple.fit = lm(formula = VoteYes ~ age,data=dataset)
  </code></pre>
  
  <p>The sample code loads in a RDA file which contains an object s in it.</p>
  
  <p>After running this, I got a very common error:</p>
  
  <pre><code>Error in eval(predvars, data, env) :  invalid 'envir' argument of type 'character' 
  </code></pre>
  
  <p>After googling for a while, I think the error has to do with the </p>
  
  <pre><code>data=dataset
  </code></pre>
  
  <p>part, since most similar errors that I got on Google is that the dataset is a String instead of a variable reference. But I think in my case dataset is not a String indeed, as in this tutorial:</p>
  
  <p><a href="http://www.learnbymarketing.com/tutorials/linear-regression-in-r/" rel="nofollow noreferrer">tutorial</a></p>
  
  <p>Thanks in advance for any suggestions!</p>