3

I have basically two questions.

  1. How do I locate the default Rprofile which is running? I have not setup a Rprofile yet, so I am not sure where it is running from.

  2. I am trying to install a few packages using the command (after doing a SUDO in the main terminal).

install.packages("RODBC","/home/rama/R/i486-pc-linux-gnu-library/2.9")

and I get back an error which says:

ERROR: failed to lock directory ‘/home/rama/R/i486-pc-linux-gnu-library/2.9’ for modifying Try removing ‘/home/rama/R/i486-pc-linux-gnu-library/2.9/00LOCK’

The downloaded packages are in ‘/tmp/RtmpkzDMVU/downloaded_packages’ Warning message: In install.packages("RODBC", "/home/rama/R/i486-pc-linux-gnu-library/2.9") : installation of package 'RODBC' had non-zero exit status

A5C1D2H2I1M1N2O1R2T1
  • 190,393
  • 28
  • 405
  • 485
Quantrix
  • 27
  • 1
  • 3

3 Answers3

5

A few comments to your questions:

  1. Look at help(Startup). You are probably running $R_HOME/etc/Rprofile [ which on Ubuntu and Debian is also available as /etc/R/Rprofile as we created softlinks to connect them ] and you have both an empty $R_HOME/etc/Rprofile.site as well as ~/.Rprofile to play with.
  2. For starters, do ls -l on the lockfile and see it is there. If so, and if you have no other R process running, remove. Re-start the package install.
  3. RODBC needs development headers for an ODBC library and all that -- again, for Debian / Ubuntu you just say sudo apt-get install r-cran-rodbc. If you run another distro, see if they have RODBC prepackaged.
  4. Regarding ~/.Rprofile there are few possible tips and tricks you can learn from this earlier StackOverflow question.
Community
  • 1
  • 1
Dirk Eddelbuettel
  • 360,940
  • 56
  • 644
  • 725
1

Concerning your package installation, I think the problem is "/home/rama/R/i486-pc-linux-gnu-library/2.9/00LOCK". Just rm this dir and the installation will work.

a ref in Chinese: http://cos.name/cn/topic/108555#post-239310

Zhilong Jia
  • 2,329
  • 1
  • 22
  • 34
-3

Thanks for the reply. That really helps indeed!. I got my RODBC package installed using sudo apt-get. That was painless. However, I am still a bit confused regarding which Rprofile is being run. I am indeed running Ubuntu Jaunty.

When I do a whereis R command, I get the following.

R: /usr/bin/R /etc/R /usr/lib/R /usr/local/lib/R /usr/share/R /usr/share/man/man1/R.1.gz

Under /etc/R I have

ldpaths Makeconf Renviron Renviron.site repositories Rprofile.site

If I cd to /usr/lib/R/etc, I have

ldpaths Makeconf Renviron Renviron.site repositories Rprofile.site

1) My question is, which of these is being used to run R?

2) When I do a sudo apt-get install r-cran-rodbc, where is the package being installed?

3) I have a home folder for R at /home/rama/R/i486-pc-linux-gnu-library/2.9 where my bioconductor packages are all located. How do I get the sudo apt-get packages to install here? (? .Rprofile) Is it even necessary?

Quantrix
  • 27
  • 1
  • 3
  • I think you should subscribe to the r-sig-debian list and ask there -- the list if focused on R use on Debian / Ubuntu. – Dirk Eddelbuettel Aug 30 '09 at 14:50
  • Re 1) They are the same files and simply soft-linked. Try 'ls -l /etc/R/Rprofile.site /usr/lib/R/etc/Rprofile.site'. Re 2) That is elementary dpkg stuff -- try 'dpkg -L r-cran-rodbc' Re 3) You misunderstand: below $HOME is yours, below /usr is for apt/dpkg. Moreover there are apt-get installable version of BioConductor. – Dirk Eddelbuettel Aug 30 '09 at 15:01
  • Great! That makes things a whole lot more clearer! Ill get onto the mailing list ASAP! – Quantrix Aug 30 '09 at 15:27
  • See you there! I missed a critical 'no' -- to my knowledge there are no apt-get repositories for BioConductor, but folks on r-sig-debian will have tips about installing in /usr/local/lib/R (my preference) or below $HOME. – Dirk Eddelbuettel Aug 30 '09 at 18:53
  • I think if you've just done a 'factory-fresh' install of R you are free to do any of the things mentioned in help(Starup). If you don't know which one is running then you probably haven't set one up (unless this is on a shared computer, or you simply can't remember where you may have put it). I'd say make .Rprofile in your home directory and give that a whirl. I also realize that this post is from 2009, so chances are you've figured it out or moved on. – astromax May 30 '13 at 02:06