[Rd] Including data in packages

From: Janko Thyson <janko.thyson_at_ku-eichstaett.de>
Date: Thu, 14 Oct 2010 21:06:48 +0200


Dear List,  

I would like to include a couple of objects in a package I am developing and I don't really get it yet. The objects should be available after package load as some functions depend on it.  

I tried the following:  

  1. Bundling all objects that I need in the file '/R/sysdata.rda' as described in the "Writing R Extensions" manual on page 7
  2. Storing the objects in /inst/extdata/somedata.rda as described in the "Writing R Extensions" manual on page 9
  3. Storing the objects in /data/somedata.rda to make it available via data() later on (I would like these objects from the user, though. So this isn't really my preferred option)

In DESCRIPTION I flagged 'LazyLoad' to 'yes'.  

The thing is that I don't understand how the actual 'transfer' happens when the package is build and installed. Where do the objects 'live' after installation and how can I access them after firing library(mypackage)? For example, there is a 'data' directory for package 'tm' (R_HOME/R-2.11.1/library/tm) but such a directory is missing even if I chose option 3) (as stated above) to get my data included. Also, how can I actually execute the lazyload?  

Any hints are greatly appreciated!  

Thanks,

Janko



R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Thu 14 Oct 2010 - 19:08:55 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 15 Oct 2010 - 12:40:10 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.

list of date sections of archive