title: Importing data into R (rdata) from Github
body: <p>I want to put some R code plus the associated data file (RData) on Github.  </p>
  
  <p>So far, everything works okay.  But when people clone the repository, I want them to be able to run the code immediately.  At the moment, this isn't possible because they will have to change their work directory (setwd) to directory that the RData file was cloned (i.e. downloaded) to.</p>
  
  <p>Therefore, I thought it might be easier, if I changed the R code such that it linked to the RData file on github.  But I cannot get this to work using the following snippet.  I think perhaps there is some issue text / binary issue.</p>
  
  <pre><code>x &lt;- RCurl::getURL("https://github.com/thefactmachine/hex-binning-gis-data/raw/master/popDensity.RData")
  y &lt;- load(x)
  </code></pre>
  
  <p>Any help would be appreciated.</p>
  
  <p>Thanks</p>