Skip to content
Prev 38927 / 63421 Next

setGeneric for residuals, etc

On 01/24/2011 08:37 AM, Kasper Daniel Hansen wrote:
As Kasper mentioned the current S4 implementation has costs in terms of
performance and usability that I suppose make it unappealing as a
'built-in' feature of R.

The current situation, where individual package developers promote a
function to an S4 generic, can lead to many issues. Some of these
represent bugs in the implementation of S4, e.g., incorrect dispatch
with complicated class hierarchies and package dependencies, that are
very challenging for the average developer (me, for instance) to fathom.
There are also more conceptual issues, e.g., two packages can each
create generics that are exported from separate package name spaces,
with the usual rules of the R search path determining which generic is
discovered. This is very confusing to the user, who has been told that
they are using a 'generic'. Documentation is also very confusing, as the
generic is documented in several different places.

These issues become increasingly important as package hierarchies
required for analysis become complicated; the average CRAN package has
relatively few dependencies and for many there will be no problem. The
class hierarchy and collection of packages for a typical Bioconductor
analysis can be quite large and complicated, leading to subtle problems.

Martin