title: R package creation: Confused about how to handle text data
body: <p>I am currently creating my first R package and I am getting confused with the way to handle text data.
  I've well understood that datasets have to be placed in the ./data subdirectory, saved into one of the .rda, .txt or .csv format, and then can be loaded with the <code>data()</code> function.</p>
  
  <p>However, the <code>data()</code> function is the same as the <code>read.table()</code> function, that is to say it reads the text file (.txt or .csv) and loads it into a data.frame.
  That is not what I want : I just want to access to my text file (.txt or .csv) and load it with my own reading function that I developped in my R source code of the package. (it's a special reading function with special checks according to what the package expects).</p>
  
  <p>After reading plenty of topics on the web, I found the system.file() function useful and used it in this way, in my test file: </p>
  
  <pre><code>current_dir=system.file(package="MYPACKAGE")
  myTextFile=paste(current_dir,"/data/myTextFile.csv",sep="")
  # Then I use my own function to load it:
  myOwnReadingFunction(myTextFile)
  </code></pre>
  
  <p>This worked fine and my <code>R CMD check</code> went well.... Until I follow the advise of the <code>R CMD check</code> log:</p>
  
  <blockquote>
    <p>"Note: significantly better compression could be obtained by using R
    CMD build --resave-data"</p>
  </blockquote>
  
  <p>Tiping <code>R CMD build --resave-data</code> before <code>R CMD check</code> moves my .csv files into .csv.bz2 and .csv.xz!
  So that what I wrote in my test file (see above) now does not work.</p>
  
  <p>Of course I guess I could, for example, change it by:</p>
  
  <pre><code>myTextFile=paste(current_dir,"/data/myTextFile.csv.bz2",sep="")
  </code></pre>
  
  <p>But I really wonder if this is the good way to handle text files in a R package. This seems to me a little "tricky".
  Is this a "good practice"? 
  Isn't another way to simply access to text files without loading it? Have someone already had the same situation?</p>
  
  <p>Bonus question: why doesn't <code>R CMD build --resave data</code> use the same compression for my two .csv files? (that is: .bz2 and .xz)</p>