[R] newbie Question on Generic and Method

Greg Snow Greg.Snow at imail.org
Wed Feb 9 19:35:25 CET 2011


The generic is what the user calls, the method is what the generic calls.

For example, the "summary" function is a generic function, when you issue a command like summary(x) then the generic function looks at what type of object x is and calls the appropriate method which might be the summary.lm function, or the summary.default function (which are methods).

-- 
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.snow at imail.org
801.408.8111


> -----Original Message-----
> From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-
> project.org] On Behalf Of Laura Smith
> Sent: Tuesday, February 08, 2011 7:59 PM
> To: r-help at r-project.org
> Subject: [R] newbie Question on Generic and Method
> 
> Hi!
> 
> Here is a newbie question, please:  what is the difference between a
> generic
> and a method?
> 
> Thanks,
> Laura
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help at 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.



More information about the R-help mailing list