From sfalcon at fhcrc.org  Wed Aug 30 19:22:38 2006
From: sfalcon at fhcrc.org (Seth Falcon)
Date: Wed, 30 Aug 2006 10:22:38 -0700
Subject: [Rd] S4 Methods dispatch
In-Reply-To: <59d7961d0608300957s109b2533t7949c3a83928149d@mail.gmail.com>
	(Henrik Bengtsson's message of "Wed, 30 Aug 2006 09:57:31 -0700")
References: <44F591C7.7070900@r-project.org>
	<59d7961d0608300957s109b2533t7949c3a83928149d@mail.gmail.com>
Message-ID: <m24pvu2l5t.fsf@ziti.fhcrc.org>

"Henrik Bengtsson" <hb at stat.berkeley.edu> writes:

> [Cross-posting to BioC-devel to]

I'll answer here for now.

> Is there an easy way to detect if a package is using S4 or not?  If
> 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?

This really is only an issue for developers and those living on the
bleeding edge.  That is, when upgrading R, one generally reinstalls
all packages anyhow (at least that is what I do).

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

Not sure, but in some testing I know that in at least _some_ cases,
one does get an error message.

> Reinstallation is also required for all package that comes as Windows
> binaries, correct?

But one has to reinstall binaries when upgrading R anyway.  Unless I'm
missing something, I would say this is a case where developers and
those on the bleeding edge just have to bite the bullet and
reinstall.  

As for identifying S4 using packages, I think it is the case that such
packages will have one or more of the following:

1. methods package in Depends
2. methods package in Imports
3. import or importFrom methods in NAMESPACE
4. a call to setClass, setMethod, or setGeneric in R sources (harder
   to identify)

Items 1 and 2 above would be easy to pull out of the return value of
installed.packages().

Best,

+ seth




[Rd] S4 Methods dispatch
Seth Falcon