tags:

views:

301

answers:

2

I had 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

Thanks for your help.

+1  A: 

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.
Dirk Eddelbuettel
A: 

Hi Dirk, 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
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
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
Great! That makes things a whole lot more clearer! Ill get onto the mailing list ASAP!
Quantrix
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