[R-pkg-devel] R CHECK warning about new S3 generic/method consistency
Usually when I write a generic I use ? in the definition to allow using
additional arguments in specific methods, see
as_bibentry <- function(x, ...) { UseMethod("as_bibentry")
}
as_bibentry.cff <- function(x, ..., what = c("preferred", "references",
"all")) {
<code>
}
but in any case the method must include at least the arguments defined in
the same order. Using ? in the generic allows me to include `what` arg with
no WARNINGs.
Have a nice day!
El El lun, 11 mar 2024 a las 19:13, CRAN.r <cran.r at proton.me> escribi?:
On Monday, March 11th, 2024 at 12:43 PM, Diego Hernang?mez Herrero < diego.hernangomezherrero at gmail.com> wrote:
Shouldn?t you include the y argument also inmyscale.default ? Your
generic is defining that argument as well. I assume (hopefully correctly) that methods don't need to include all the arguments of the generic. I get the same warning if I use "..." instead of y, too.