Re: [Rd] Stop packages and datasets to be loaded on startup.

From: Simon Urbanek <>
Date: Sat, 30 Jan 2010 12:02:04 -0500

On Jan 30, 2010, at 11:08 AM, Guillaume Yziquel wrote:

> Hi.
> I would like to know how to start an embedded R session, and avoid datasets and the standard library packages to be loaded on startup.
> I've been looking at littler's code (so this is partly a question to Dirk Eddelbuettel...):

>>        /* We don't require() default packages upon startup; rather, we
>>         * set up delayedAssign's instead. see autoloads().
>>         */
>>        if (setenv("R_DEFAULT_PACKAGES","NULL",1) != 0){
>>                perror("ERROR: couldn't set/replace R_DEFAULT_PACKAGES");
>>                exit(1);
>>        }

> The code above happens before Rf_initEmbeddedR in littler.
> So I gather that just setting R_DEFAULT_PACKAGES to NULL should be OK. But then, what is the rather complicated stuff in the autoload() function in littler.c for?
> And concerning datasets, how do you avoid loading them?


Setting R_DEFAULT_PACKAGES to NULL makes sure that default packages are not loaded. Note that "datasets" are not loaded at all -- you can load the datasets package which will make them available, but they are not really "loaded". The minimal setup is simply


However, it's your responsibility to load any packages that your code needs in that case.

Simon mailing list Received on Sat 30 Jan 2010 - 17:05:45 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 Sun 31 Jan 2010 - 18:10:18 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive