[R] Where does R look for library packages - there is no package called 'BRugs'

conor1725 metasaurus at gmail.com
Fri Feb 4 07:33:25 CET 2011



David Winsemius wrote:
> 
> 
> On Jan 30, 2011, at 5:42 PM, conor1725 wrote:
> 
>>
>> I am have installed R on Windows 7 machine. R got installed in the  
>> directory
>> C:\Program Files\R\R-2.12.0. Then I installed the package BRugs  
>> using the
>> install.packages command. I did not get an option during the  
>> installation as
>> to what directory I wanted BRugs installed in. It ended up in
>> C:\myusername\Documents as C:\myusername\Documents\R\win-library 
>> \2.12\BRugs.
>> When I open and R and run the command library(BRugs) it works fine.
>>
>> However, I would like to move the BRugs stuff out of my Documents  
>> folder,
>> either to a subdirectory under Documents of my choosing or to  
>> somewhere in
>> C:\Program Files\R\R-2.12.0. I tried just moving the whole folder and
>> subfolders R\win-library\2.12\... from Documents to a subfolder. I  
>> don't
>> think this matters, but just to complete, there is also a folder  
>> called Coda
>> with the BRugs folder in the 2.12 folder and of course there are  
>> subfolders
>> and files under each of the folders Coda and BRugs. Then when I try
>> library(BRugs) I get the error message "Error in library(BRugs) :  
>> there is
>> no package called 'BRugs'". So it seems R only knows to look for the  
>> BRugs
>> package in it's original installation location.
>>
>> How can I get it to work having BRugs in one of my desired locations?
> 
> Then you need to understand where R will be able to find your  
> packages, and how one might change that:
> 
> ?libPaths
> 
> -- 
> David Winsemius, MD
> West Hartford, CT
> 
> 

I'm posting a specific answer to my own question for the record since The
help for libPaths (actually should be ?.libPaths) doesn't explain this
fully. I created the file Renviron.site in the folder C:\Program
Files\R\R-2.12.0\etc and put the text R_LIBS =
C:/Users/myusername/Documents/.../R/win-library/2.12 in that file.  The ...
represents the path for the subdirectory that I moved R\win-library\2.12\...
to.
-- 
View this message in context: http://r.789695.n4.nabble.com/Where-does-R-look-for-library-packages-there-is-no-package-called-BRugs-tp3247748p3259520.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list