I've just installed version 1.4.0 of R, and am experiencing a puzzling phenomenon with the library() function. I have .lib.loc set as follows:> .lib.loc[1] "/usr/local/lib/R/library" "/home/faculty/rolf/Rlib" If I invoke> library(melvin)I get the error message Error in library(melvin) : There is no package called `melvin' but if I invoke> library(melvin,lib.loc="/home/faculty/rolf/Rlib")the package ``melvin'' gets loaded with no problems. What gives? Is the .lib.loc object not being used in 1.4.0 the way it was used in 1.3.1? (I can't see anything about this in the ``USER-VISIBLE CHANGES'' in Peter Dalgaard's posting to this list yesterday.) Or have I done something silly? cheers, Rolf Turner rolf at math.unb.ca Details:> version_ platform sparc-sun-solaris2.7 arch sparc os solaris2.7 system sparc, solaris2.7 status major 1 minor 4.0 year 2001 month 12 day 19 language R -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
On Thu, 20 Dec 2001, Rolf Turner wrote:> > I've just installed version 1.4.0 of R, and am experiencing > a puzzling phenomenon with the library() function. > > I have .lib.loc set as follows: > > > .lib.loc > [1] "/usr/local/lib/R/library" "/home/faculty/rolf/Rlib" > > If I invoke > > > library(melvin) > > I get the error message > > Error in library(melvin) : There is no package called `melvin' > > but if I invoke > > > library(melvin,lib.loc="/home/faculty/rolf/Rlib") > > the package ``melvin'' gets loaded with no problems. > > What gives? Is the .lib.loc object not being used in 1.4.0 the way > it was used in 1.3.1? (I can't see anything about this in the > ``USER-VISIBLE CHANGES'' in Peter Dalgaard's posting to this list > yesterday.) Or have I done something silly?There was a late change you will see down the list o New function .libPaths() for getting or setting the paths to the library trees R knows about. This is still stored in .lib.loc, which however should no longer be accessed directly. so you might like to try that. `USER-VISIBLE CHANGES' was an idea (of mine) to highlight import ones: there may well be others. The person who changed this one obviously did not think it important enough: the point is that .lib.loc from package:base is used now, not one you set in the workspace. Thanks for bringing this up: I was unaware of the change. It confirms that the recommended way (set R_LIBS or use .libPaths()) should be adhered to! -- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272860 (secr) Oxford OX1 3TG, UK Fax: +44 1865 272595 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Many thanks to Prof. Brian Ripley for quickly solving my problem. As you will have already seen from his posting, what I should have done, INSTEAD OF > .lib.loc <- c("/usr/local/lib/R/library","/home/faculty/rolf/Rlib") was > .libPaths("/home/faculty/rolf/Rlib") which appends the named library to the existing set of paths to library trees. I could also issue the command setenv R_LIBS /home/faculty/rolf/Rlib (say by putting this line in my .cshrc file) which ensures that my personal library gets included in the search tree whenever R is started. (Notice that it is not necessary to include the ``system library'', i.e. /usr/local/lib/R/library, in the setenv command --- the system library is always available, willy-nilly. If you want to have your local library searched ***before*** the system library you could set R_LIBS by (the analogue of) setenv R_LIBS /home/faculty/rolf/Rlib:/usr/local/lib/R/library The important thing to remember is that the local object ``.lib.loc'' gets ignored in R-1.4.0; you can assign it a value, but doing so will have no useful effect whatever. cheers, Rolf Turner rolf at math.unb.ca -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._