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

Peter Dalgaard p.dalgaard at biostat.ku.dk
Mon Jul 5 11:59:59 CEST 2004

a.prioglio at city.ac.uk writes:

> Hi,
> perhaps this is again a silly question ...
> 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...

> 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.

   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)             FAX: (+45) 35327907

More information about the R-help mailing list