[Rd] Run script automatically when package is loaded

From: Janko Thyson <janko.thyson.rstuff_at_googlemail.com>
Date: Sat, 12 Mar 2011 14:06:58 +0100

Dear list,

is it possible to specify a script that is executed "automatically" when my package is mounted via 'require(my.pkg)' or 'library(my.pkg)'?

Id' like to specify execute a small init function that creates some crucial environment structures. As it's always the first thing to do when using the package, I wanted to "hide" it from the user so he won't have to think about this step.

Can I use the lazy-loading functionality of packages for that (Writing R Extensions, Section 1.1.5 Data in packages, pp. 10)?

Thanks for any suggestions,

R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Sat 12 Mar 2011 - 13:21:59 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 Sat 12 Mar 2011 - 15:40:31 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