Re: [R] accessing source code in R packages

From: Spencer Graves <spencer.graves_at_pdf.com>
Date: Thu 22 Sep 2005 - 18:23:46 EST

          Is there general documentation on a procedure to follow to:

          (a) Find what methods are available for a particular class of objects?

          (b) Find what classes of objects have methods defined for a partilar generic function?

          (c) Get the code that's actually used?

          For example, I recently needed to access numbers associated with an object of class "lmer". Sundar suggested I use with 'getMethod("show", "summary.lmer")'. However, this doesn't work with the example below.

	  Thanks,
	  spencer graves

Francisco J. Zagmutt wrote:

> or getAnywhere()
> 
> 

>> From: "ronggui.wong" <042045003@fudan.edu.cn>
>> Reply-To: 042045003@fudan.edu.cn
>> To: "r-help@stat.math.ethz.ch" <r-help@stat.math.ethz.ch>
>> Subject: Re: [R] accessing source code in R packages
>> Date: Thu, 22 Sep 2005 10:03:45 +0800
>>
>>
>>
>> >R is open source. You can download the source code from CRAN.
>> >
>> >If you mean at the R prompt, usually you see the code for a function by
>> >typing the name of the function at the R prompt, without parentheses.
>> >`Usually' because some methods are delibrately `hidden' from users, and
>> >should only be accessed through their generics. There are still ways
>> to get
>> >around that.
>> sometimes,the getS3method is helpfull.
>>
>> >library(MASS)
>> > princomp.default
>> Error: object "princomp.default" not found
>> > getS3method("princomp","default")
>> function (x, cor = FALSE, scores = TRUE, covmat = NULL, subset =
>> rep(TRUE,
>> nrow(as.matrix(x))), ...)
>> {
>> ----snip----
>>
>>
>> >
>> >However, the code you get at the R prompt is not the _source_, as it
>> does
>> >not contain any original comments. You need to go to the source I
>> refer to
>> >above.
>> >
>> >Andy
>> >
>> >> From: ritesh@pdx.edu
>> >>
>> >> Hi,
>> >>
>> >> I am new the R world and would like to know how can I access
>> >> source codes of
>> >> standard functions in R?
>> >>
>> >> Thanks,
>> >> Ritesh.
>> >>
>> >> ______________________________________________
>> >> R-help@stat.math.ethz.ch mailing list
>> >> https://stat.ethz.ch/mailman/listinfo/r-help
>> >> PLEASE do read the posting guide!
>> >> http://www.R-project.org/posting-guide.html
>> >>
>> >>
>> >>
>> >
>> >______________________________________________
>> >R-help@stat.math.ethz.ch mailing list
>> >https://stat.ethz.ch/mailman/listinfo/r-help
>> >PLEASE do read the posting guide!
>> http://www.R-project.org/posting-guide.html
>>
>> = = = = = = = = = = = = = = = = = = = =
>>
>>
>>         崑
>> 撰
>>
>>
>>         ronggui.wong
>>         042045003@fudan.edu.cn
>>           2005-09-22
>>
> 
> 

>> ______________________________________________
>> R-help@stat.math.ethz.ch mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide!
>> http://www.R-project.org/posting-guide.html
> 
> 
> 
> ------------------------------------------------------------------------
> 
> ______________________________________________
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

-- 
Spencer Graves, PhD
Senior Development Engineer
PDF Solutions, Inc.
333 West San Carlos Street Suite 700
San Jose, CA 95110, USA

spencer.graves@pdf.com
www.pdf.com <http://www.pdf.com>
Tel:  408-938-4420
Fax: 408-280-7915

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Received on Thu Sep 22 18:29:49 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:40:25 EST