Skip to content

method show

2 messages · Andrea Spano, Martin Morgan

#
On 11/19/2012 04:21 PM, Andrea Spano wrote:
There are several object systems in R. Your use of setMethod indicates that you 
are creating an S4 method, to be associated with an S4 generic. 'show' is a 
generic in the S4 object system, and setMethod(show, <...>) associates your 
method with this generic. 'summary' is a generic in the S3 object system. 
setMethod(summary, <...>) realizes that there is not yet an S4 generic summary, 
so creates an S4 generic (with the S3 generic as the default method) and then 
adds your method to the newly created S4 generic. The S3 generic is not copied 
to the global environment.

Martin