[R] Rprofile etc in Linux

Prof Brian Ripley ripley at stats.ox.ac.uk
Wed Nov 28 12:20:19 CET 2001


On Wed, 28 Nov 2001, Agustin Lobo wrote:

>
> Hi!
>
> I do not have an Rprofile file in $R_HOME/etc, but I do have one
> in $R_HOME/library/base/R. I thought I could include a .First()
> function in a new $R_HOME/etc/Rprofile file for attaching a couple
> files which have custom "always needed" functions. But
> would the new $R_HOME/etc/Rprofile create a conflict with
> $R_HOME/library/base/R/Rprofile (in particular because the later
> also has a .First() function)?

Yes.  See ?.First for the ordering.  This is deliberate: users should be
able to override the default .First.

Just put

    require("ctest", quietly=TRUE)

in your .First.

I suggest you load your `"always needed" functions' by using a local
library rather than load them into your workspace.


I would rather like to improve this mechanism. S4 implementations have
variants on .S.chapters and S.init: the latter corresponds to R's
Rprofile files, the former is a list of chapters (aka packages in R)
to be attached/loaded.  So the R analogue would be a system file
R.packages containing `ctest', and also ~/.R.packages containing a list of
packages to be loaded at startup *in addition to* those in R.packages.

Does that sound a worthwhile idea?

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272860 (secr)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list