[BioC] how to see the content of a R function in a package?

Joern Toedling toedling at ebi.ac.uk
Tue Jun 19 16:50:51 CEST 2007


Hi James,

that means that this function 'errorest' is only a S3 generic function
and the effect of it depends on the class of the object it is invoked for.
See for example this manual about method dispatching with S3:
http://cran.r-project.org/doc/manuals/R-lang.html#Object_002doriented-programming

The command

methods("errorest")

tells you that there is one function defined to work with data frames,
called "errorest.data.frame", and that it is not exported in ipred's
Namespace.

You can get its souce code by typing

ipred:::errorest.data.frame

Typing
ipred:::errorest.default
tells you in addition that this S3 method is only defined for
data.frames in ipred and not for other object classes, so this is
probably what you are looking for.

Best regards,
Joern

James Anderson wrote:
> Thanks for your suggestions. I tried what you have suggested. I am trying to find the source code of function errorest in the R package ipred (I guess it's in CRAN, not bioconductor), I can only find:
>
> function (formula, data, ...) 
> UseMethod("errorest", data)
> <environment: namespace:ipred>
>
> no matter what I type errorest, or ipred:::errorest, 
> if I type errorest(), there is some error message. 
>
> James
>   

-- 
Joern Toedling
EMBL - European Bioinformatics Institute
Wellcome Trust Genome Campus
Hinxton, Cambridge CB10 1SD
United Kingdom
Phone  +44(0)1223 492566
Email  toedling at ebi.ac.uk



More information about the Bioconductor mailing list