[R] showMethods doubt

From: Ernesto Jardim <ernesto_at_ipimar.pt>
Date: Thu 02 Jun 2005 - 20:06:55 EST


Hi,

I'm developing in S4 and I wanted to see the methods for a specific class using showMethods but I didn't succed. Can someone help ? See the example below.

setClass("myclass",

	representation(
		name	="character"
	)

)

setGeneric("mymeth", function(obj, ...){

	standardGeneric("mymeth")
	}

)

setMethod("mymeth", signature("myclass"), function(obj){

        print(paste("Hi,", obj@name, "and I don't know what to do with showMethods !"))

        }
)

Now if you do:

> myobj <- new("myclass", name="my name is joe")
> mymeth(myobj)

[1] "Hi, my name is joe and I don't know what to do with showMethods !"

So the method is working, let's use showMethods:

> showMethods(classes="myclass")

Function "addNextMethod":
<Empty Methods List>

Function "body<-":
<Empty Methods List>

Function "coerce":
<Empty Methods List>

Function "initialize":
.Object = "myclass"

     (inherited from .Object = "ANY")

Function "loadMethod":
<Empty Methods List>

Function "show":
object = "myclass"

     (inherited from object = "ANY")
NULL mymeth does not show on that list, why ?

Regards

EJ



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Thu Jun 02 20:21:48 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:32:21 EST