[Rd] loading a particular package version

From: James MacDonald <jmacdon_at_med.umich.edu>
Date: Thu 21 Oct 2004 - 06:13:52 EST

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

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

R-devel@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Thu Oct 21 06:23:37 2004

This archive was generated by hypermail 2.1.8 : Wed 03 Nov 2004 - 22:45:22 EST