Skip to content
Prev 32807 / 63421 Next

install.packages now intentionally references .Rprofile?

I see that related to this thread, 'R CMD INSTALL' (like
'install.packages') also reads the .Rprofile before beginning. This
caused package installation headaches for me that developers should be
aware (as it was very difficult to debug).

I added a setwd() to my .Rprofile [for example: setwd("/tmp")] to keep
.Rhistory files from popping up in directories throughout my computer.
This causes package installation to fail completely with an unhelpful
error message. For example (any package will do here):
Warning: invalid package 'zoo_1.5-6.tar.gz'
Error: ERROR: no packages specified

Removing 'setwd(...)' from the .Rprofile restores normal package
installation behavior.

I'd like to request that either setwd() not break installation, or the
user can disable .Rprofile reading on R CMD INSTALL (for instance with
an option such as --no-init-file). I'll use Heather's solution below for
the short-term, but would rather not have to completely turn off my
.Rprofile for non-interactive scripts.

Thanks, Robert


-----Original Message-----
From: r-devel-bounces at r-project.org
[mailto:r-devel-bounces at r-project.org] On Behalf Of Heather Turner
Sent: Friday, May 22, 2009 6:13 AM
To: Mark Kimpel
Cc: Prof Brian Ripley; r-devel at stat.math.ethz.ch
Subject: Re: [Rd] install.packages now intentionally references
.Rprofile?

I had a similar problem when moving to R-2.9.0 as my .Rprofile called
update.packages(). The solution was to use

if(interactive()) {
	utils:::update.packages(ask = FALSE)
}

HTH,

Heather
Mark Kimpel wrote:
modified by
not
correctly,
reason
the
date of
quite
-- B.
<ripley at stats.ox.ac.uk>wrote:
library
http://bioconductor.org/packages/2.4/bioc/src/contrib/Biobase_2.4.1.tar.
gz
http://bioconductor.org/packages/2.4/bioc/src/contrib/Biobase_2.4.1.tar.
gz
LC_CTYPE=en_US.UTF-8;LC_NUMERIC=C;LC_TIME=en_US.UTF-8;LC_COLLATE=en_US.U
TF-8;LC_MONETARY=C;LC_MESSAGES=en_US.UTF-8;LC_PAPER=en_US.UTF-8;LC_NAME=
C;LC_ADDRESS=C;LC_TELEPHONE=C;LC_MEASUREMENT=en_US.UTF-8;LC_IDENTIFICATI
ON=C
http://www.stats.ox.ac.uk/~ripley/<http://www.stats.ox.ac.uk/%7Eripley/>
______________________________________________
R-devel at r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel