[R] How to show the definition of a S3 function?

Peng Yu pengyu.ut at gmail.com
Wed Feb 3 05:59:45 CET 2010


On Tue, Feb 2, 2010 at 10:52 PM, Jeff Laake <Jeff.Laake at noaa.gov> wrote:
> Try methods("contrast") to see functions.  Depends on class of fit.  eg
> contrast.lm

I tried the following command. How to get the definition of, say, contrast.lm?

> methods("contrast")
[1] contrast.Design contrast.geese  contrast.gls    contrast.lm
[5] contrast.lme
> methods("contrast.lm")
no methods were found
Warning message:
In methods("contrast.lm") :
  function 'contrast.lm' appears not to be generic
> contrast.lm
function (fit, ...)
contrastCalc(fit, ...)
<environment: namespace:contrast>




> On 2/2/2010 8:48 PM, Peng Yu wrote:
>>>
>>> library(contrast)
>>> contrast
>>>
>>
>> function (fit, ...)
>> UseMethod("contrast")
>> <environment: namespace:contrast>
>>
>> I guess the above function is S3. Could somebody let me know how to
>> show the function body in an R session?
>>
>> ______________________________________________
>> 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