[R] Help Updating and Installing R Packages

From: Tariq Perwez <tariq.perwez_at_gmail.com>
Date: Tue, 15 Jul 2008 21:48:56 -0400

Hi Everyone,

I have a few fairly basic questions about upgrading and installing R packages. First off, I am using Ubuntu Hardy Heron and have R 2.7.1 installed and working perfectly. I usually access R via Emacs ESS interface which I am still trying to get the hang of. My questions and issues are as follows:

Question 1: I started R and wanted to upgrade the installed R packages. So, I issue the command >upgrade.packages()
 and after selecting the CRAN mirror sites, I get the following message:

lattice :
 Version 0.17-8 installed in /usr/lib/R/library  Version 0.17-10 available at http://www.ibiblio.org/pub/languages/R/CRAN Update (y/N/c)?

(To this, I respond with "y", but then I get the following:)

Warning in install.packages(update[instlib == l, "Package"], l, contriburl = contriburl, :
  'lib = "/usr/lib/R/library"' is not writable

(Off course, it is NOT writable because it did not ask for the administrative password.

Would you like to create a personal library '~/R/i486-pc-linux-gnu-library/2.7'
to install packages into? (y/n)

I do not want to create new directories; I just want to upgrade where the older version already exists. So I respond with "n" and get this:)

Error in install.packages(update[instlib == l, "Package"], l, contriburl = contriburl, :
  unable to install packages

My question is how do I go about upgrading AND installing packages from within R by using administrative account? I must say that at least for now, I was able to get around this issue by staring R as:

sudo R

and then using upgrade.packages(). But I would like a better solution when I am already in an R session.

Question 2: When I started R via

sudo R

and issued >upgrade.packages()

I had problem upgrading lattice package. I got the following error message:

The downloaded packages are in

Updating HTML index of packages in '.Library' Warning message:
In install.packages(update[instlib == l, "Package"], l, contriburl = contriburl, :
  installation of package 'lattice' had non-zero exit status

Even >upgrade.packages(dependencies = TRUE) resulted in the same error. Does anyone know if this is just a problem on my system or perhaps someone else has run into the same issue. What does this all mean? What I do not understand is why are there .h missing files? How the heck did lattice get installed in the first place if these header files were missing?

Question 3: This is more of a general question that has been on my mind for sometime. If I just want to install some packages/data base etc that I would like to be "local", perhaps in my home directory, which library path would be recommended? Sometimes I feel that I would like to download some database or other packaged code that I want to play around with but would later like to get rid of, a library in the home directory that is still in R's path might be better. I would appreciate suggestions. What are others doing in this situation? Currently I have the following outcome of .libPaths() command:

> .libPaths()
[1] "/usr/local/lib/R/site-library" "/usr/lib/R/site-library" [3] "/usr/lib/R/library"

Which library path should I choose?

Best regards,


        [[alternative HTML version deleted]]

R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Wed 16 Jul 2008 - 01:51:59 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 16 Jul 2008 - 06:31:47 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive