[R] My_first_R_package: almost there

Agustin Lobo
Tue, 26 Jun 2001 12:10:00 -0000

Well, thanks to you all
I''ve been able to install my first
little package. I''ve dumped
some of my Splus(PC) functions
to an ascii file (*.R), created
the directory structure and the
DESCRIPTION and INDEX files. Then
I checked and installed with:

R CMD INSTALL -l ~/.R/library Sutilpangea

because I found that I have an .R directory
in my home where a subdirectory .R/library
has links to where the packages really are
(/usr/lib/R/library). Therefore, I decided
to keep  my own packages in .R/library
while the CRAN packages really stay in
/usr/lib/R/library.

Now the only problem is that, by default, R
searches packages in /usr/lib/R/library
because of the value of R_HOME:

> system ("echo $R_HOME")
/usr/lib/R

It would be better if R would
search packages in my .R/library
directory, where R would find both my packages
and the links for the CRAN packages.
How can I change the deafault searching
path for the packages? (I know
I can always do library(xxx, lib.loc="/home/alobo/.R/library"),
but it would be nicer having this as default).

Thanks

Agus