title: R: Load data directly without lazyload promise
body: <p>I have a package with a number of csvs that I've saved as compressed <code>.RData</code> files. I'm trying to load them e.g. with </p>
  
  <pre><code>mysamples &lt;- data("samples")
  </code></pre>
  
  <p>But <code>data("samples")</code> loads samples as a promise which is only evaluated if called e.g.</p>
  
  <pre><code>samples
  </code></pre>
  
  <p>Is there a way to load data into memory directly, rather than lazyloading as a promise? Or do I have to</p>
  
  <pre><code>data(samples)
  samples
  mysamples &lt;- samples
  </code></pre>
  
  <p>for every dataset? I was hoping <code>data("samples", envir = .GlobalEnv)</code> would do that but it doesn't. Is there a different function for this? I've tried <code>load</code> but it cannot open the compressed file. Thanks for any help.</p>
  
  <p>Edit: if I turn off lazy loading then I can use</p>
  
  <pre><code>data("samples")
  mysamples &lt;- samples
  </code></pre>
  
  <p>But then I have 2 files in the environment rather than one, so would have to <code>rm(samples)</code> which again means 3 operations required for each file to assign a database as named object in the environment. Compared to 1 for e.g. <code>read.csv()</code>. Am I missing a simple function here or is this just the way it is?</p>