Re: [R] code for latex function in Hmisc

From: Marc Schwartz (via MN) <mschwartz_at_mn.rr.com>
Date: Tue 02 May 2006 - 07:57:16 EST

On Mon, 2006-05-01 at 17:21 -0400, Brian Quinif wrote:
> Forgive my ignorance, but how I can take a look at the code for the
> latex function in the Hmisc library?
>
> I tried just typing "latex" but all I got was this:
>
> > latex
> function (object, title = first.word(deparse(substitute(object))),
> ...)
> {
> if (!length(oldClass(object)))
> oldClass(object) <- data.class(object)
> UseMethod("latex")
> }
>
> What should I do?
>
> Thanks,
>
> BQ

Brian,

latex() is the generic function, which in turn dispatches one of several methods, based upon the class of the 'object' as the first argument.

To see the specific methods and thus the individual functions that are actually called, use:

> methods(latex)

 [1] latex.bystats                  latex.bystats2
 [3] latex.default                  latex.describe
 [5] latex.describe.single          latex.function
 [7] latex.list                     latex.summary.formula.cross
 [9] latex.summary.formula.response latex.summary.formula.reverse

See ?methods

You can then use the above functions to see the code for the individual methods as it exists within R. Note that this is not technically the source code, which would be contained in the Hmisc tarball on CRAN. The latter would have author comments and other content that will not appear within the R session. However, the code as seen within R is more often than not, sufficient to understand what is happening.

HTH, Marc Schwartz



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 Tue May 02 08:00:32 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Tue 02 May 2006 - 10:09:56 EST.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.