Skip to content
Prev 10378 / 12125 Next

[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?:

  
  
Message-ID: <CAA-ibax5UHAm1VSZyivucy8aX_0DPLkO2SC5_0DPNH3WqBuZ1A@mail.gmail.com>
In-Reply-To: <hV4lx_U-zSXxiV1OTTm0J0FGohychf4_b0vU90KlE0JwYYiK2TZTya9uRLOdsfj9CUDjX4qYp7oF8Nbqwn62M-rFtWC23Ds_eVA_De_ls5g=@proton.me>