[R] libPaths how to change (R 3.0.2 64bit, RStudio 0.98.501, Windows 7)

Jeff Newmiller jdnewmil at dcn.davis.CA.us
Wed Feb 26 10:18:45 CET 2014

What you are really asking is how environment variables get set outside of R, which is very OS-specific and not on topic here, and there can be numerous ways for it to happen even on a single OS. I will warn you that the path syntax can vary in Windows depending on where it gets set so beware of ~ expansion (doesn't always work) and forward/back-slash distinctions. You can start looking in the System control panel under Advanced and Environment Variables... you will probably need Admin privileges to go there. Google is your friend.
Jeff Newmiller                        The     .....       .....  Go Live...
DCN:<jdnewmil at dcn.davis.ca.us>        Basics: ##.#.       ##.#.  Live Go...
                                      Live:   OO#.. Dead: OO#..  Playing
Research Engineer (Solar/Batteries            O.O#.       #.O#.  with
/Software/Embedded Controllers)               .OO#.       .OO#.  rocks...1k
Sent from my phone. Please excuse my brevity.

On February 25, 2014 10:57:00 AM PST, "Lopez, Dan" <lopez235 at llnl.gov> wrote:
>R Experts,
>I had a problem when trying to install package tm. The install looked
>successful ("Package 'tm' successfully unpacked and MD5 sums checked")
>but I could not load it through
>library(tm). It kept complaining that tm package was not installed.
>So it was through this problem that I realized I had two locations
>where my packages are stored:
>C:R/R-3.0.2/library  #Preferred
>\\\\lab.gov/users/lopez/Data/documents/R/win-library/3.0  #NOT
>I am not sure when and how the second location was created.  But now I
>want to change my default location to the "Preferred" location.
>I referred to
>but I don't understand how to set the environment variables R_LIBS or
>R_LIBS_SITE, which is what I understood I need to do. I looked in
>R\R-3.0.2\etc and did not find a Renviron file (per
>So I created one (file name exactly as "Renviron") and set the variable
>(R_LIBS_USER=~/R/library) there but when I do the following I still see
>both library paths:
> > .libPaths()
>[1] "\\\\lab.gov/users/lopez/Data/documents/R/win-library/3.0"
>I only want the preferred path. How do I remove the unwanted path?
>BTW I did find a solution to installing tm properly but want to prevent
>similar problem from happening in the future by only having one library
>Dan Lopez
>Workforce Analyst
>HRIM - Workforce Analytics & Metrics
>Strategic Human Resources Management
>(925) 422-0814
>	[[alternative HTML version deleted]]
>R-help at r-project.org mailing list
>PLEASE do read the posting guide
>and provide commented, minimal, self-contained, reproducible code.

More information about the R-help mailing list