Kenneth Takagi
2010-May-30 03:44 UTC
[R-sig-Debian] Changing R_LIB_USER variable in ubuntu...
Hi, I'm an experienced R user on windows, but new to linux. This may be an issue with how R (or Ubuntu) was install on my computer, but maybe not. I just installed Ubuntu 10.04, I have administrator privileges and am using R 2.11. Here goes: I'd like to change the location where R installs packages not included in the base installation (using install.packages()). Right now it is saving them to "/home/ken/R/i486-pc-linux-gnu-library/2.11" like it should based on the default R_LIB_USER setting in /etc/R/Renviron. I think that this is quite a bulky filepath and would prefer to shorten it (ie. "~/R/2.11/library"). Unfortunately, /etc/R/ is read only for me (as is /usr/R/). Therefore I can't change the R_LIB_USER variable. I understand the rationale behind protecting /etc/ and /usr/, but is there any way to customize this variable once and not worry about it when I install future packages? Thank a lot! Ken
Michael Rutter
2010-May-30 11:29 UTC
[R-sig-Debian] Changing R_LIB_USER variable in ubuntu...
On 05/29/2010 11:44 PM, Kenneth Takagi wrote:> Hi, > > I'm an experienced R user on windows, but new to linux. This may be an > issue with how R (or Ubuntu) was install on my computer, but maybe not. > I just installed Ubuntu 10.04, I have administrator privileges and am > using R 2.11. Here goes: > > I'd like to change the location where R installs packages not included > in the base installation (using install.packages()). Right now it is > saving them to > "/home/ken/R/i486-pc-linux-gnu-library/2.11" like it should based on > the default R_LIB_USER setting in /etc/R/Renviron. > > I think that this is quite a bulky filepath and would prefer to shorten > it (ie. "~/R/2.11/library"). Unfortunately, /etc/R/ is read only for me > (as is /usr/R/). Therefore I can't change the R_LIB_USER variable. I > understand the rationale behind protecting /etc/ and /usr/, but is there > any way to customize this variable once and not worry about it when I > install future packages?Ken, When I install packages in R using Ubunutu, I always use 'sudo'. [command line]sudo R ...R launches... >install.packages("foo") That will install the packages in a /usr directory and all users on the machine will have access to them. If that is not what you are looking for, let us know. Michael
Kenneth Takagi
2010-May-30 14:22 UTC
[R-sig-Debian] Changing R_LIB_USER variable in ubuntu...
thank a lot for you answer. Since I'm new to linux, I still have a couple questions based on your response: 1) do I create a file named .Renvirons or just Renvirons in my home directory? @) In the following lines of the script:> ### Packages in the home directory: > R_LIBS="~/.R-site/site-library:${R_LIBS}"how exactly would I change the file path to"~/R/2.11/library") for example? Thanks for putting up with my limited knowledge, I'm slowly learning! Best, Ken Quoting Christophe Bonenfant <bonenfan at biomserv.univ-lyon1.fr>:> Dear Ken, > > I changed the lib path as you would like on my Debian system. The only > thing you have to do is to create a .Renviron file in your home directory. > > Mine looks like: > > ### xpdf as the default pdf viewer > R_PDFVIEWER='/usr/bin/xpdf' > > ### To get R in English: > LANGUAGE=en > > ### Packages in the home directory: > R_LIBS="~/.R-site/site-library:${R_LIBS}" > > Change the path to your convenience. R will read this file when > launched. You will not need root privileges to intall packages anymore. > > Hope this helps. > > Christophe > > Le 30/05/2010 05:44, Kenneth Takagi a ?crit : >> Hi, >> >> I'm an experienced R user on windows, but new to linux. This may be an >> issue with how R (or Ubuntu) was install on my computer, but maybe not. >> I just installed Ubuntu 10.04, I have administrator privileges and am >> using R 2.11. Here goes: >> >> I'd like to change the location where R installs packages not included >> in the base installation (using install.packages()). Right now it is >> saving them to >> "/home/ken/R/i486-pc-linux-gnu-library/2.11" like it should based on >> the default R_LIB_USER setting in /etc/R/Renviron. >> >> I think that this is quite a bulky filepath and would prefer to shorten >> it (ie. "~/R/2.11/library"). Unfortunately, /etc/R/ is read only for me >> (as is /usr/R/). Therefore I can't change the R_LIB_USER variable. I >> understand the rationale behind protecting /etc/ and /usr/, but is there >> any way to customize this variable once and not worry about it when I >> install future packages? >> >> Thank a lot! >> >> Ken >> >> _______________________________________________ >> R-SIG-Debian mailing list >> R-SIG-Debian at r-project.org >> https://stat.ethz.ch/mailman/listinfo/r-sig-debian >> >> > > -- > ________________________________________________________ > > UMR CNRS 5558, > Laboratoire Biom?trie et Biologie ?volutive > Universit? Claude Bernard, Lyon 1 > 43, boulevard du 11 novembre 1918 > 69622 Villeurbanne Cedex > FRANCE \\\ > ( "> > Phone : (+33) 4 72 44 81 11 )( > Fax: (+33) 4 72 43 13 88 // ) > --//""-- > > http://krikouille.free.fr/~bonenfan/site/kris.html > ________________________________________________________ > >
Kenneth Takagi
2010-May-30 14:54 UTC
[R-sig-Debian] Changing R_LIB_USER variable in ubuntu...
Thanks, I will give this a try and see how it goes! Best, Ken Quoting Christophe Bonenfant <bonenfan at biomserv.univ-lyon1.fr>:> Hi Ken, > >> thank a lot for you answer. Since I'm new to linux, I still have a >> couple questions based on your response: > > You're welcome, no problem! > >> 1) do I create a file named .Renvirons or just Renvirons in my home >> directory? > > Create a ".Renviron" file with a dot, meaning this file is hidden. And > as far as I know R will be looking for a .Renviron but not Renviron file > by default. > > Try "ls -a" in a shell to see all the hidden files of your home directory. > >> @) In the following lines of the script: >>> ### Packages in the home directory: >>> R_LIBS="~/.R-site/site-library:${R_LIBS}" >> >> how exactly would I change the file path to"~/R/2.11/library") for example? > > Well, I would try this: > > R_LIBS="~/R/2.11/library:${R_LIBS}" > > then you will have the following structure: > > /home/ken/ > ----------/R/2.11/library/ > --------------------------package1/ > --------------------------package2/ > ... > > in your home directory. > > The point is that you now have a /R folder in you home when browsing > files with Nautilus. Once again, add a dot before to make it hidden > (ctrl+H to see it in Nautilus then) and keep things tidy in your home. > > As Mickael rightly pointed out, this way of managing libraries is > local, it means that another user of you computer will not see and nor > access the libraries you installed as "ken" user. To do so, you need to > install package as a root as Mickael suggests. > >> Thanks for putting up with my limited knowledge, I'm slowly learning! > > It is a matter of weeks, then you'll feel comfortable with the > configuration file in GNU/Linux. > > Good luck! > > Christophe > > >
Johannes Ranke
2010-May-30 16:12 UTC
[R-sig-Debian] Changing R_LIB_USER variable in ubuntu...
Hi Ken, you can override R_LIBS_USER in ~/.Rprofile (in your case this expands to /home/ken/.Rprofile). For example, I have R_LIBS_USER="~/lib/R/library" in my file. Details can be found from within R with > ?Startup Note that R CMD does not seem to respect the settings in ~/.Rprofile. If I recall correctly, it used to in earlier R versions. Kind regards, Johannes Am Sonntag, 30. Mai 2010, um 05:44:24 schrieb Kenneth Takagi:> Hi, > > I'm an experienced R user on windows, but new to linux. This may be an > issue with how R (or Ubuntu) was install on my computer, but maybe not. > I just installed Ubuntu 10.04, I have administrator privileges and > am using R 2.11. Here goes: > > I'd like to change the location where R installs packages not included > in the base installation (using install.packages()). Right now it is > saving them to > "/home/ken/R/i486-pc-linux-gnu-library/2.11" like it should based on > the default R_LIB_USER setting in /etc/R/Renviron. > > I think that this is quite a bulky filepath and would prefer to shorten > it (ie. "~/R/2.11/library"). Unfortunately, /etc/R/ is read only for > me (as is /usr/R/). Therefore I can't change the R_LIB_USER variable. > I understand the rationale behind protecting /etc/ and /usr/, but is > there any way to customize this variable once and not worry about it > when I install future packages? > > Thank a lot! > > Ken > > _______________________________________________ > R-SIG-Debian mailing list > R-SIG-Debian at r-project.org > https://stat.ethz.ch/mailman/listinfo/r-sig-debian
Maybe Matching Threads
- How to go about getting a change in the SPEC file from which R is built on EPEL?
- change default path for installing r-cran packages by sudo apt r-cran...?
- Debian Testing: ~/.Renviron seems to not being read (R_LIBS not set)
- R_LIBS difficulty ?
- R CMD check not reading R_LIBS from ~/.R/check.Renviron