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 <[email protected]> escribió:
> On Monday, March 11th, 2024 at 12:43 PM, Diego Hernangómez Herrero <
> [email protected]> 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.
>
[[alternative HTML version deleted]]
______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel