[R] auto load package splines

Duncan Murdoch murdoch at stats.uwo.ca
Wed Jul 5 15:36:38 CEST 2006


On 7/5/2006 9:23 AM, Xiaodong Jin wrote:
> May I ask how to include following procedures into R script (such as first.r) such that it will do an automatical call next time after I open R?
>    
>   Packages -> Load Packages -> splines

You can do this through your .Rprofile file, or site-wide through the 
RHOME/etc/Rprofile file.  There's an example of the latter in the 
?Startup man page.   It can also be done by defining the environment 
variable

R_DEFAULT_PACKAGES=splines

but then *only* the packages you list will be attached (i.e. splines in 
the example above); you're probably better off working with .Rprofile.

Duncan Murdoch



More information about the R-help mailing list