[Rd] loading a particular package version

James MacDonald jmacdon at med.umich.edu
Wed Oct 20 22:13:52 CEST 2004


Hi all,

This is either a feature request or a plea for help (depending on
whether or not I am missing something). I am trying to write a function
that will load a package of a particular version, but the package
installation was most likely not versioned e.g., --with-package-version

For instance, say there are two packages, foo_1.2.3 and foo_1.3.4, and
they are installed in two different libraries, /usr/local/R/library and
/home/me/library. .libPaths() returns the library paths in the opposite
order, so require(foo) loads the wrong package if I want to load
foo_1.3.4. Since they are not versioned installs, I cannot use
require(foo, version="1.3.4"). In addition, I cannot use require(foo,
lib.loc="/home/me/library") because require doesn't have a lib.loc
argument.

I can, however use library(foo, lib.loc="/home/me/library"), and this
works in an interactive use of the function. Unfortunately when I run R
CMD check, this bombs out on some vignette code as well as example code
that call the function. Anyway, AFAIK library() is really not designed
for use within functions.

So, long story short, is there a way around this problem that I just
don't see, or is it possible to get a lib.loc argument to require()?

TIA,

Jim



James W. MacDonald
Affymetrix and cDNA Microarray Core
University of Michigan Cancer Center
1500 E. Medical Center Drive
7410 CCGC
Ann Arbor MI 48109
734-647-5623


**********************************************************
Electronic Mail is not secure, may not be read every day, and should not be used for urgent or sensitive issues.



More information about the R-devel mailing list