[Rd] S4 structure classes and Ops methods

From: John Chambers <jmc_at_r-project.org>
Date: Sun, 15 Feb 2009 11:53:43 -0800

The methods package has methods for group generic "Ops" for S4 classes that extend "array", "structure" or "vector". The methods mainly try to produce a consistent result when structures and vectors are combined. See class?structure, section "Methods".

In the development version of R committed today (r47924), these methods will be activated by loading any package with such classes. This was always the intention, but up to version 2.8.1, the methods were not activated UNLESS the package also defined some relevant methods itself. (Fixing this turned out to need a whole new mechanism, to indicate that the package needed the methods in question.)

Note to package maintainers: if you have a package that defines such classes and does not define methods for operators, method selection may change for objects from these classes. In some cases, the new methods will be stricter (returning a vector result instead of mixing up attributes, for example, as the base code sometimes does). I haven't encountered examples, but please rerun CMD check if you think your package fits the description.


R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Sun 15 Feb 2009 - 19:02:27 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 16 Feb 2009 - 02:30:24 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.

list of date sections of archive