Re: [Rd] S4 methods and polymorophism

From: Eric Lecoutre <lecoutre_at_stat.ucl.ac.be>
Date: Wed 22 Sep 2004 - 19:20:09 EST

At 10:52 22/09/2004, Matthias.Kohl@uni-bayreuth.de wrote:
>I think, it must be x instead of object?
>
>setMethod("length", signature(x="Collection"), function(x) length(x@ID))

Hi,

This is right, this latest works - Thank you.

For "show" methods, I did understand I had to use "object" with

---
 > getGeneric("show")
standardGeneric for "show" defined from package "methods"

function (object)
standardGeneric("show")
<environment: 017E6D18>
Methods may be defined for arguments: object
---

I didn't have the same information for "length"... except in the help page 
of the function length which provides the list of its arguments, so that I 
should have found that myself.
Anyway, thank you very much: now at least I have understand that argument 
names must exactly match argument names of the generic and my knowledge of 
S4 classes is better.

Eric

______________________________________________
R-devel@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Received on Wed Sep 22 19:52:46 2004

This archive was generated by hypermail 2.1.8 : Wed 03 Nov 2004 - 22:45:17 EST