[R] search path for attaching packages

Duncan Murdoch murdoch.duncan at gmail.com
Tue Aug 31 01:11:12 CEST 2010


On 30/08/2010 6:00 PM, Atkinson, Elizabeth J. (Beth) wrote:
> 	Several of us locally are puzzling over the following problem:
> 
> 	We have a central repository of R packages on our linux system.
> Occasionally, we'd like to install a different version of the same
> package (such as making updates to the survival package before it is
> released to the larger group, or a downloaded beta version).   When
> using the library function, it appears that lib.loc is not being used
> and instead the central repository is being used.  We've even tried
> modifying .libPaths( ) so that our local path is first in the search
> list.  Is this a bug or a "feature"?
> 
> 	For example: 
> 
> 	>
> install.packages('DBI',lib='/data1/bsi/epi/s105816.SNPlinkage/CNV/rlib')
> 	> library(DBI,
> lib.loc='/data1/bsi/epi/s105816.SNPlinkage/CNV/rlib')
> 
> 	I can look in my directory and see that DBI is version 0.2-5,
> but when I use the library command I get the version installed in the
> central location instead of in my specified directory.  
> 
> 	> library(help=DBI)

You didn't specify the lib.loc in this command.  Typing library() will 
tell you where it will look, in the order given by .libPaths().

Duncan Murdoch


> 
> 			Information on package 'DBI'
> 
> 	Package:       DBI
> 	Version:       0.2-4
> 	Title:         R Database Interface
> 	Author:        R Special Interest Group on Databases (R-SIG-DB)
> 	Maintainer:    David A. James <daj025 at gmail.com>
> 	Depends:       R (>= 2.3.0), methods
> 	LazyLoad:      yes
> 	License:       LGPL (version 2 or later)
> 	Collate:       DBI.R Util.R zzz.R
> 	Packaged:      Tue Oct 16 21:43:31 2007; dj
> 	Built:         R 2.10.0; ; 2009-10-26 17:51:14 UTC; unix
> 
> 	Further information is available in the following vignettes in
> 	directory
> '/usr/local/biotools/r/R-2.10.0/lib64/R/library/DBI/doc':
> 
>> version
>                _                            
> platform       x86_64-unknown-linux-gnu     
> arch           x86_64                       
> os             linux-gnu                    
> system         x86_64, linux-gnu            
> status                                      
> major          2                            
> minor          10.0                         
> year           2009                         
> month          10                           
> day            26                           
> svn rev        50208                        
> language       R                            
> version.string R version 2.10.0 (2009-10-26)
> 
> Beth Atkinson, MS | Statistician III | Division of Biomedical Statistics
> & Informatics| Assistant Professor of Biostatistics  
> Phone: 507-284-0431 | Admin Assistant: 507-266-4556 | Fax: 507-284-9542
> | atkinson at mayo.edu
> Mayo Clinic | 200 First Street SW | Rochester, MN 55905 |
> www.mayoclinic.org
> 
> 
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list