Re: [Rd] Help for methods

From: Hin-Tak Leung <hin-tak.leung_at_cimr.cam.ac.uk>
Date: Tue 19 Sep 2006 - 12:25:07 GMT

You are supposed to do:

?summary.lm
?summary.data.frame

for S3 methods. The former works, the latter doesn't - which is probably considered a bug, but then the usage of some of the generics are probably considered obvious and fundamental enough that summary.data.frame doesn't really behave in any substantially different way compared to what is said in ?summary and ?Summary .

hadley wickham wrote:
> Help for help says:
>
> The 'topic' argument may also be a function call, to ask for
> documentation on a corresponding method. See the section on
> method documentation.
>
> and
>
> The authors of formal ('S4') methods can provide documentation on
> specific methods, as well as overall documentation on the methods
> of a particular function. The '"?"' operator allows access to
> this documentation in three ways.
>
> ...
>
> There are two different ways to look for documentation on a
> particular method. The first is to supply the 'topic' argument in
> the form of a function call, omitting the 'type' argument. The
> effect is to look for documentation on the method that would be
> used if this function call were actually evaluated. See the
> examples below. If the function is not a generic (no S4 methods
> are defined for it), the help reverts to documentation on the
> function name.
>
> Which doesn't explicitly mention whether this will work for S3 either
> way, but the results from:
>
> ?summary
> ?summary(lm(wt ~ mpg, data=mtcars)
> ?summary(data.frame())
>
> seem to indicate that it doesn't (at least in my R2.3.0, which is out
> of date, but I did also search the latest NEWS file for anthing
> mentioning help). Would it be possible to extend this method to deal
> with S3 classes as well?
>
> Hadley
>
> ______________________________________________
> R-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel



R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Tue Sep 19 22:30:20 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 19 Sep 2006 - 13:30:09 GMT.

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