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,", [EMAIL PROTECTED], "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
______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html