From winstonchang1 at gmail.com  Tue Jun 17 22:08:11 2014
From: winstonchang1 at gmail.com (Winston Chang)
Date: Tue, 17 Jun 2014 15:08:11 -0500
Subject: [Rd] R CMD check warning with S3 method
In-Reply-To: <CAFOpNVGGT+tpdAZ42Q+jkWntAE+N=Ctq_D5pKbVVHx7F6_m0RQ@mail.gmail.com>
References: <CAFOpNVGGT+tpdAZ42Q+jkWntAE+N=Ctq_D5pKbVVHx7F6_m0RQ@mail.gmail.com>
Message-ID: <CAFOpNVH6t487eY8GQh=pvZJXRYpj2eEYRyOEZ4ZR=8rOKkskYA@mail.gmail.com>

I forgot to add this - here's the warning:

* checking S3 generic/method consistency ... WARNING
Warning: declared S3 method 'filter.test' not found
See section 'Generic functions and methods' of the 'Writing R
Extensions' manual.


On Tue, Jun 17, 2014 at 2:21 PM, Winston Chang <winstonchang1 at gmail.com> wrote:
> I'm getting an R CMD check warning with a package (call it package A)
> that defines an S3 method but not the generic. The generic is defined
> in another package (package B). Package A imports the S3 generic from
> B. And there's one additional detail: the generic overrides a function
> in the stats package.
>
> I've created a minimal test package which reproduces the problem:
>   https://github.com/wch/s3methodtest
>
> In this case:
> - the package imports dplyr, for the dplyr::filter S3 generic
> - the package defines a S3 method filter.test
> - it imports dplyr, which defines a filter S3 generic
>
> The warning doesn't occur when package dplyr is in Depends instead of
> Imports. It also doesn't occur if the method is for a generic that
> does not override an existing function like stats::filter. For
> example, if instead of filter.test, I define select.test
> (dplyr::select is also an S3 generic), then there's no warning.
>
> This warning seems incorrect. Is this a bug? I'm interested in
> submitting the package to CRAN soon, so any advice on what to do is
> appreciated.
>
> Thanks,
> -Winston



[Rd] R CMD check warning with S3 method
Winston Chang