[R] What is a sane way to deal with changes in library loadings after 1.9.0?

a.prioglio@city.ac.uk a.prioglio at city.ac.uk
Mon Jul 5 12:35:43 CEST 2004

On Mon, Jul 05, 2004 at 11:59:59AM +0200, Peter Dalgaard wrote:
> > As I am using R on different machines, some are version 1.8.1 and some
> > 1.9.1.
> > 
> > One of the changes between these versions is the change in default
> > libraries loaded when reading scripts.
> > 
> > So I started my scripts with:
> > 
> > if (R.version$minor>="9.0") {
> > 	library(utils)
> > 	library(graphics)
> > 	library(stats)
> > }
> > 
> > It appeard to work but now I get "could'n find function factanal" in
> > version 1.8.1.
>  help.search("factanal") should get you there in a jiffy...

Yes! True thanks.
> > What would be a safe and sane way to ensure all relevant libraries are
> > loaded irrespective of version?
> They're back-compatible (for a while yet) -- library(mva) will get you
> the stats package, so just including the packages that were relevant
> for 1.8.x should do. There are a few cases where you'll include too
> much, e.g. som things were moved from MASS into stats, so these days
> you might not require MASS where you did before, but that is a
> relatively rare situation.

Well, I'm certainly new to R. Still without the explicit loading of the
above libraries my scripts while loading on 1.8.1 were definetely not
loading on 1.9.1. I'm using the same account on all machines so I expect
to have the same environment. Or should I?

One thing I noticed now, a search() on a 1.8.1 machine after the loading
of the scripts now returns nothing (after encountering an error though).

How can one know what environments are loaded? Calling R --verbose did
not seem to clarify this point.

Thanks for any help.
Antonio Prioglio

We are what we repeatedly do. Excellence, then, is not an act, but a habit.

     X                           - AGAINST MS ATTACHMENTS
    / \


More information about the R-help mailing list