[R] Installing packages from RProfile.site file

abhisarihan abhisarihan at gmail.com
Tue Jul 17 21:34:04 CEST 2012

I am trying to install custom packages upon starting R. A lot of the code
that is written by us right now is available for editing to the users. To
try and protect the code, I am packaging the production level code and
having the users install it on their machine during start up.

However, when I try to install packages in RProfile.site file, the program
goes into a loop and R is constantly launched over and over. I noticed that
a lock file for the package is created along with the package in the library
folder within R. 

Here is the code I have added to the site file:

if(length(grep("customPackage", installed.packages()[,1]))==0) {
	install.packages("customPackage", repos=NULL, type="source")

When I try to run this code after starting R (without changing the site
file), it installs the package perfectly fine and moves on. However, when I
try to do it through the RProfile file, that's when it creates the problems.

Any help on this matter would be greatly appreciated!

View this message in context: http://r.789695.n4.nabble.com/Installing-packages-from-RProfile-site-file-tp4636794.html
Sent from the R help mailing list archive at Nabble.com.

More information about the R-help mailing list