[Rd] Documenting newly created generic versions of non-generic base R functions

Gavin Simpson gavin.simpson at ucl.ac.uk
Mon Oct 10 18:29:42 CEST 2005


Hi,

Following the Writing R Extensions manual, I created a method for the
cor function. As cor is not a generic, I followed the advice of section
6.1 of the same manual and did the following:

cor <- function(x, ...) UseMethod("cor")
cor.default <- stats::cor
cor.symcoca <- function{ some code }

I used package.skeleton to create the basic set-up of my package,
containing the above functions.

Do I need to provide a .Rd file for cor and cor.default? - seeing as
cor.default is cor currently.

What is the best way to handle documenting functions produced using the
above hi-jack methodology?

Cheers

Gav
-- 
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%
Gavin Simpson                     [T] +44 (0)20 7679 5522
ENSIS Research Fellow             [F] +44 (0)20 7679 7565
ENSIS Ltd. & ECRC                 [E] gavin.simpsonATNOSPAMucl.ac.uk
UCL Department of Geography       [W] http://www.ucl.ac.uk/~ucfagls/cv/
26 Bedford Way                    [W] http://www.ucl.ac.uk/~ucfagls/
London.  WC1H 0AP.
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%



More information about the R-devel mailing list