[R] R CMD check thinks my function is an S3 method

Prof Brian Ripley ripley at stats.ox.ac.uk
Thu Aug 4 07:14:52 CEST 2011


On Wed, 3 Aug 2011, Peter Langfelder wrote:

> Hi all,
>
> in my package I have a function with name plot.cor (this function is
> inherited from another legacy package). According to CRAN package
> checks reports, the check apparently thinks plot.cor is a method for
> the plot generic (I hope I'm using the correct terminology).
>
> checking Rd \usage sections ... NOTE
> S3 methods shown with full name in documentation object 'plot.cor':
> ‘plot.cor’
>
>
> Although technically it doesn't seem to be an error (and CRAN

Technically this is an error if you did not intend it to be an S3 
method: the note says you incorrectly documented your S3 method.

> maintainers haven't warned me about this), I was asked to clean up the
> package to the point where the package check goes through without any
> problems.
>
> My question is: do I need to rename the function (e.g. to plotCor,
> which won't be mistaken for an S3 method) or is there a way to tell R
> that this is not an S3 method?

The former.  (There is a list of historical exceptions used by R CMD 
check, but we will not be adding to it for new packages.)

>
> Thanks,
>
> Peter
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595


More information about the R-help mailing list