[R] easy way to find all extractor functions and the datatypes of what they return

Gabor Grothendieck ggrothendieck at gmail.com
Sat Oct 10 14:43:43 CEST 2009


Try this (where "lm" is the class of the lm output):

> methods(class = "lm")
 [1] add1.lm*           alias.lm*          anova.lm           case.names.lm*
 [5] confint.lm*        cooks.distance.lm* deviance.lm*       dfbeta.lm*
 [9] dfbetas.lm*        drop1.lm*          dummy.coef.lm*     effects.lm*
[13] extractAIC.lm*     family.lm*         formula.lm*        hatvalues.lm
[17] influence.lm*      kappa.lm           labels.lm*         logLik.lm*
[21] model.frame.lm     model.matrix.lm    plot.lm            predict.lm
[25] print.lm           proj.lm*           residuals.lm       rstandard.lm
[29] rstudent.lm        simulate.lm*       summary.lm         variable.names.lm*
[33] vcov.lm*

   Non-visible functions are asterisked


On Sat, Oct 10, 2009 at 3:21 AM, Robert Wilkins <robstdev at gmail.com> wrote:
> Am I asking for too much:
> for any object that a stat proc returns  ( y <- lm( y~x) , etc ) ) , is there
> a super convenient function like give_all_extractors( y ) that lists all
> extractor functions , the datatype returned , and a text descriptor
> field ("pairwisepval" "lsmean" etc)
>
> That would just be so convenient.
>
> What are my options for querying an object so that I can quickly learn
> the extractor functions to pull out the data and manipulate it?
> Will the datatypes returned usually be named vectors and named
> matrices, indiced by categorical values in the data
> ( "Male" "Female"  "Placebo" "DrugB" etc )? If they are indexed by 1 ,
> 2 , 3 , 4 , it's easier to lose track.
>
> thanks a bunch in advance
>
> ______________________________________________
> 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