Skip to content
Prev 9428 / 63421 Next

system.file() and .path.package() incorrect with package versions

The system.file() and .path.package() functions appear to be unaware of
package versions and can return incorrect information or fail if a package
is installed using `installWithVers = TRUE' of install.packages().  For
example, I can run
and
without a problem.  However,
[1] ""

but
[1] "/home/rpeng/R-local/libs/session_1.0.1"

which I kind of expected.  Also, .path.package() produces:
[1] "/home/rpeng/R-local/libs/session_1.0.1"     
[2] "/home/rpeng/install/R/lib/R/library/methods"
[3] "/home/rpeng/install/R/lib/R/library/ctest"  
[4] "/home/rpeng/install/R/lib/R/library/mva"    
[5] "/home/rpeng/install/R/lib/R/library/modreg" 
[6] "/home/rpeng/install/R/lib/R/library/nls"    
[7] "/home/rpeng/install/R/lib/R/library/ts"     
[8] "/home/rpeng/install/R/lib/R/library/base"   

but
Error in .path.package(package = "session") : 
        none of the packages are loaded

This is problematic because many packages run their examples using
system.file() or .path.package() and those will not run when packages are
installed with versions.  Also, some packages call .path.package() in
.First.lib(), in which case the package will usually not even load.
_                
platform i686-pc-linux-gnu
arch     i686             
os       linux-gnu        
system   i686, linux-gnu  
status                    
major    1                
minor    7.0              
year     2003             
month    04               
day      16               
language R                

-roger
_______________________________
UCLA Department of Statistics
http://www.stat.ucla.edu/~rpeng