Re: [Rd] Clarification on generic functions and methods

From: Ken Knoblauch <ken.knoblauch_at_inserm.fr>
Date: Wed, 11 Nov 2009 20:58:08 +0000 (UTC)

Doran, Harold <HDoran <at> air.org> writes:
>
> Thank you, Henrik. This actually doesn't work when I build the package,
which may only require a slight
> modification to what I'm doing now. First, I create a NAMESPACE as:
>
> ### NAMESPACE FILE CONTENTS
> export(jml2)
> S3method(jml2, fit)
> S3method(jml2, default)
> S3method(jml2, formula)
> S3method(print, jml)
> S3method(summary, jml)
> S3method(print, summary.jml)
>
> So, only the generic function (jml) is exported.
>
> Now, I do as you suggest below for the generic function, but keep all others
as they were previously. That
> creates a situation where jml.formula, jml.default, and jml have different
 arguments.
>
> Now, in the .Rd file for the jml function I want the user to see the usage for
the jml.formula method, which
> obviously has more args than "...". So, the .Rd file is structured as
 (for testing purposes only):

How about if you document the default method as well as the generic method in your man page. See ?lag for an example, and I've come across several others recently.

HTH, Ken

-- 
Ken Knoblauch
Inserm U846
Stem-cell and Brain Research Institute
Department of Integrative Neurosciences
18 avenue du Doyen L├ępine
69500 Bron
France
tel: +33 (0)4 72 91 34 77
fax: +33 (0)4 72 91 34 61
portable: +33 (0)6 84 10 64 10
http://www.sbri.fr/members/kenneth-knoblauch.html

______________________________________________
R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Received on Wed 11 Nov 2009 - 21:04:17 GMT

This archive was generated by hypermail 2.2.0 : Wed 11 Nov 2009 - 21:50:23 GMT