Re: [Rd] Help for methods

2006-10-02 Thread John Chambers
The convention for documenting S4 methods provides a general way to get the documentation for a method, given the name of the function and the name(s) of the classes in the signature: method?"FUN,CLASS1,CLASS2,..." where FUN is the name of the function and CLASS1, etc. are the names of the c

Re: [Rd] Help for methods

2006-09-30 Thread hadley wickham
> See the .helpForCall function in utils. It would recognize that the > function was an S4 generic, and then work out the signature and look for > matching help. I think working out the signature in the case above > would require it to call lm(...). So there's a precedent for what I > called a "

Re: [Rd] Help for methods

2006-09-30 Thread Duncan Murdoch
On 9/30/2006 1:17 AM, hadley wickham wrote: >> Yes, I agree that the current help system doesn't work very well on S3 >> methods. But I don't know how to fix it. I think the only way it could >> know what to do on a construction like >> >> ?summary(lm(...)) >> >> would be to actually evaluate sum

Re: [Rd] Help for methods

2006-09-29 Thread hadley wickham
> Yes, I agree that the current help system doesn't work very well on S3 > methods. But I don't know how to fix it. I think the only way it could > know what to do on a construction like > > ?summary(lm(...)) > > would be to actually evaluate summary(lm(...)) (or maybe just lm(...)), > and I thin

Re: [Rd] Help for methods

2006-09-29 Thread hadley wickham
> I think the spirit of Hadley's request could be handled by introducing a > declaration for S3 methods and by inserting S4-style alias{} lines into > their documentation. For example, if a function, say > setOldGeneric("summary"), similar to setOldClass, informed the system that > "summary" was

Re: [Rd] Help for methods

2006-09-19 Thread John Chambers
It's not likely that S3 methods will ever go away, at least in the sense that all the code using them would be rewritten. What we can work towards is to make more of the automated tools work for S3 methods as well as S4. This will usually involve package owners generating some information, th

Re: [Rd] Help for methods

2006-09-19 Thread Duncan Murdoch
On 9/19/2006 9:16 AM, hadley wickham wrote: >> In the alpha of 2.4.0, both suggestions above work, as do ?summary and >> ?summary(data.frame()). ?summary(lm()) gives the same man page, rather >> than the summary.lm page (but the page does have a link to that page). > > That's great. > > The fact

Re: [Rd] Help for methods

2006-09-19 Thread hadley wickham
> I do not follow this. When I type ?summary.data.frame I get a > summary help page where I can also find info about S3 method for class > 'data.frame'. If I am not wrong it is > > \alias{summary.data.frame} > > that takes care of this. Oops, summary.data.frame was a bad example, except perhaps to

Re: [Rd] Help for methods

2006-09-19 Thread hadley wickham
> > But you also have to be able to identify if it is a S3 function or an > > S4 method (or an ordinary function). > > Why not just type ?summary, which as I said, does tell you up front? If R can save the novice user a couple of steps in their search for help, why not do it? Getting documentatio

Re: [Rd] Help for methods

2006-09-19 Thread Prof Brian Ripley
On Tue, 19 Sep 2006, hadley wickham wrote: >> > Well, I know that, and you know that, but how is anyone supposed to >> > figure it out? It means that you need to have a working knowledge of >> > the S3 and S4 class systems before you can use the help to reliably >> > get the documentation you nee

Re: [Rd] Help for methods

2006-09-19 Thread hadley wickham
> In the alpha of 2.4.0, both suggestions above work, as do ?summary and > ?summary(data.frame()). ?summary(lm()) gives the same man page, rather > than the summary.lm page (but the page does have a link to that page). That's great. The fact that summary includes a link to summary.lm is relevant

Re: [Rd] Help for methods

2006-09-19 Thread Gabor Grothendieck
On my system all three of the ?summary commands listed in your post bring up help (if you add the missing parenthesis to the middle one). I am using "Version 2.3.1 Patched (2006-06-04 r38279)" on Windows XP. On 9/18/06, hadley wickham <[EMAIL PROTECTED]> wrote: > Help for help says: > > The 'topi

Re: [Rd] Help for methods

2006-09-19 Thread hadley wickham
> > Well, I know that, and you know that, but how is anyone supposed to > > figure it out? It means that you need to have a working knowledge of > > the S3 and S4 class systems before you can use the help to reliably > > get the documentation you need. > > For S3 you do to understand that there ar

Re: [Rd] Help for methods

2006-09-19 Thread Gregor Gorjanc
Hin-Tak Leung cimr.cam.ac.uk> writes: > > 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 I do not follow this. When I type ?summary.data.frame I ge

Re: [Rd] Help for methods

2006-09-19 Thread Duncan Murdoch
On 9/19/2006 8:52 AM, hadley wickham wrote: >> 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 funda

Re: [Rd] Help for methods

2006-09-19 Thread Prof Brian Ripley
On Tue, 19 Sep 2006, hadley wickham wrote: >> You are supposed to do: >> >> ?summary.lm >> ?summary.data.frame >> >> for S3 methods. The former works, the latter doesn't - which is ?summary.data.frame does work on my systems. >> probably considered a bug, but then the usage of some of the >> gen

Re: [Rd] Help for methods

2006-09-19 Thread hadley wickham
> 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 real

Re: [Rd] Help for methods

2006-09-19 Thread Hin-Tak Leung
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

[Rd] Help for methods

2006-09-18 Thread hadley wickham
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 ove