[Rd] S4 Methods dispatch

Henrik Bengtsson hb at stat.berkeley.edu
Wed Aug 30 19:42:49 CEST 2006


On 8/30/06, Prof Brian Ripley <ripley at stats.ox.ac.uk> wrote:
> On Wed, 30 Aug 2006, Henrik Bengtsson wrote:
>
> > [Cross-posting to BioC-devel to]
> >
> > Thank you for this.
> >
> > > The changes are internal but extensive.  All packages that use S4
> > > methods and classes need to be reinstalled from source to use the new
> > > version.
> >
> > Is there an easy way to detect if a package is using S4 or not?  If
>
> Yes, look at the Depends field of the DESCRIPTION
>
> a <- installed.packages()
> aa <- as.vector(a[grep("methods", a[, "Depends"]), 1])
> install.packages(aa)

I think it's more complicated than this.  First of all, is it
mandatory for a package to be explicit about 'methods'?  Second, there
are many packages that imports 'methods' implicitly via dependency of
other S4 packages, .e.g see many Bioconductor packages.  Thus, for
this to work we have to build the dependency graph, and it have to
work across repositories.

One way would be to load packages (that are explicit about 'methods')
and do some investigation on them.

>From John Chambers updated post on this thread, it look like we should
reinstall all package to be on the safe side.

>
> If you want to install them in the same place as before, do this for each
> library in turn.
>
> I'd hold off for a few days if you can: some packages will not yet
> reinstall.
>
> > so, I could scan my already installed libraries and call
> > install.packages() on its S4 subset of packages.  The alternative is
> > to do install.packages() an all libraries (sic!).  Bioconductor: maybe
> > biocLite() could have such an update mechanism built in internally?
> >
> > If I miss to reinstall one S4 package, what should I expect?  I assume
> > there will be an error, but I just want to confirm that there is no
> > risk of getting weird "results" but still a running program?
> >
> > Reinstallation is also required for all package that comes as Windows
> > binaries, correct?
>
> Correct, and from source at that since Uwe is not yet building packages
> under R-devel (and his '2.4' is really 2.3, as I understand it).

Ah, that last part is an EXTREMELY IMPORTANT PIECE OF INFORMATION,
related to this S4 update.

I predict that there will unfortunately be a few postings of people
being bitten by this.  I can see how you run install/update.packages()
on a Windows machine and things stops working.  Then there is no
repository to fall back to, and if you do not have the machinery for
installing from source on Windows it's going to be a mess.

It sound like that creating a copy of the (binary) package reprocitory
as is today would be the first precocious step to take.  If problems
occur until Uwe gets his "2.4" up and running, at least this can be
used as a backup for people being bitten by the above.

I'm on Windows too, and at least I will make a local copy of what I've
got today and I will avoid doing install/update.packages() on
CRAN/Bioconductor until I know things are working.  I will also keep
my current R-devel installation around, because that should work with
Uwe's current "2.3" rep, (I believe?).

/H

>
> --
> 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 272866 (PA)
> Oxford OX1 3TG, UK                Fax:  +44 1865 272595
>




More information about the R-devel mailing list