title: Loading text data in R package
body: <p>I'm working on an R package and having a terrible time trying to load data for internal use in the package.  </p>
  
  <p>The package is set up with <code>LazyData: false</code> and the data itself is in a file called <code>params.csv</code> file in the <code>data</code> directory.  If, within one of my functions, I write the following:</p>
  
  <pre><code>data(params, envir=environment())
  </code></pre>
  
  <p>Then the file loads and I can use it in the code.  <em>But</em> as stated in the docs, it's loaded with <code>read.table(file, sep=";")</code> and I have character values that I don't want treated as factors.  If this was a normal <code>read.table</code> call, then I'd add <code>stringsAsFactors=FALSE</code> and everything would be fine.  </p>
  
  <p>The <em>Note</em> section of <code>?data</code> suggests that you can use an R file in the data folder to manually do this loading, but I can't figure it out.  I've tried making a file called <code>params.r</code> in the data directory as follows:</p>
  
  <pre><code>read.table("params.csv", sep=";", stringsAsFactors=FALSE)
  </code></pre>
  
  <p>but when it loads, R complains that the <code>read.table</code> function is not found.  Again, the docs say that <code>data</code> somehow loads <code>utils</code> before sourcing the file, but when I put a standard <code>library(utils)</code> call at the start of my script, it complains that <code>utils</code> can't be found.</p>
  
  <p>I even tried setting <code>options(stringsAsFactors=FALSE)</code> before the <code>data</code> call but that doesn't seem to work either.  The data are still loaded as factors.</p>
  
  <p>Are there any package experts out there that know how to work around this?  I'd rather not have to manually kludge everything to the right format after loading; it just seems inelegant.</p>