[R] Standard method for S4 object

Thibaut Jombart jombart at biomserv.univ-lyon1.fr
Sat Feb 23 16:23:12 CET 2008


Christophe Genolini wrote:

>Hi the list,
>
>I am defining a new class MyClass. Shortly, I will submit a package with 
>it. Before, I would like to know if there is a kind of "non official 
>list" of what method a new S4 object have.
>More precisely, personnaly, I use 'print', 'summary' and 'plot' a lot. 
>So for my new class, I define these 3 methods. Is there some other 
>method that a R user can raisonnably expect ? Some "minimum basic tools"...
>
>Thanks
>
>Christophe
>  
>
Hi,

/I think your question should be more relevant on Rdev./
I am not sure that 'print' is called when printing an S4 object. I think 
'show' is used instead.
You might find which methods are usual: 
http://wiki.r-project.org/rwiki/doku.php?id=tips:classes-s4
may help.
Personnally I would find stuff like "names",  "$", "$<-", or "[" useful 
as these are usual operation with S3 objects.

Regards,

Thibaut.
-- 
######################################
Thibaut JOMBART
CNRS UMR 5558 - Laboratoire de Biométrie et Biologie Evolutive
Universite Lyon 1
43 bd du 11 novembre 1918
69622 Villeurbanne Cedex
Tél. : 04.72.43.29.35
Fax : 04.72.43.13.88
jombart at biomserv.univ-lyon1.fr
http://lbbe.univ-lyon1.fr/-Jombart-Thibaut-.html?lang=en
http://pbil.univ-lyon1.fr/software/adegenet/



More information about the R-help mailing list