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? How can I get a complete list of all S3 classes currently available? Thanks,
David Winsemius
2010-Aug-02 14:56 UTC
[R] How to understand whether a class is a S3 class?
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
Megh Dal <megh700004 <at> yahoo.com> writes:> > 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? > > How can I get a complete list of all S3 classes currently available? > > Thanks, > >There is the isS4 function ?isS4