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

Martin Morgan mtmorgan at fhcrc.org
Tue Jun 19 16:49:16 CEST 2007


James,

'errorest' is an S3 generic (indicated by 'UseMethod' in its
body). To see defined S3 methods, use

> methods(errorest)
[1] errorest.data.frame* errorest.default*   

   Non-visible functions are asterisked

This says there are two different functions defined, one for
data.frame, one for default. Both are 'non-visible'. The S3 way to
access non-visible functions is

> getAnywhere(errorest.data.frame)

(visible functions are accessible with just the full function name,
e.g., print.default).

Martin

James Anderson <janderson_net at yahoo.com> writes:

> 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 <toedling at ebi.ac.uk> wrote: And if you want to see the source code of  a function that is not 
> exported in a package's namespace, you have to type the function's name 
> without parentheses, as Niki pointed out, but precede it with the 
> package name and three colons, for example:
> Biobase:::matchpt
>
> Regards,
> Joern
>
> r.athanasiadou wrote:
>> You mean typing the name of the function without parentheses or anything
>> else following?(after you have called the appropriate package of course)
>>
>> niki
>>
>> ICB
>> Swann Building
>> The King's Buildings
>> University of Edinburgh
>> Edinburgh, EH9 3JR
>> Scotland
>> UK
>>
>> tel:(0044)0131-6507072
>> fax:(0044)0131-6505379
>> R.Athanasiadou at sms.ed.ac.uk
>>
>>
>> -----Original Message-----
>> From: bioconductor-bounces at stat.math.ethz.ch
>> [mailto:bioconductor-bounces at stat.math.ethz.ch] On Behalf Of James Anderson
>> Sent: 17 June 2007 17:00
>> To: bioconductor
>> Subject: [BioC] how to see the content of a R function in a package?
>>
>> There seems to be a R command for doing this, I can not remember it though. 
>>
>> Thanks,
>>
>> James
>>
>>
>
> _______________________________________________
> Bioconductor mailing list
> Bioconductor at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/bioconductor
> Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor
>
>
>  
> ---------------------------------
>
>
> 	[[alternative HTML version deleted]]
>
> _______________________________________________
> Bioconductor mailing list
> Bioconductor at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/bioconductor
> Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor

-- 
Martin Morgan
Bioconductor / Computational Biology
http://bioconductor.org



More information about the Bioconductor mailing list