On Aug 1, 2010, at 2:08 PM, Megh Dal wrote:

Hi, is there any way to say: "this class 'x' is a S3 class?" For example what is the type of class "data.frame"? Is it a S3 class or S4?

S3 and S4 refer to methods, i.e. functions; "class" is an attribute of objects. And I am not sure that the phrase "type of class" has any meaning. A data.frame is a list with the class attribute of "data.frame". There are a variety of functions that will return the class, type, and mode of an object, and the function call methods("fn") will return the registered S3 methods for a generic function with name == "fn". The showMethods() function will do the same for S4 methods but needs somewwhat different arguments.

?methods
?class
?showMethods

--
David Winsemius, MD
West Hartford, CT

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to