[R-pkg-devel] troubleshooting hard-to-reproduce errors

Iñaki Ucar iuc@r @ending from fedor@project@org
Tue Jan 8 09:36:35 CET 2019


On Tue, 8 Jan 2019 at 08:39, Sebastian Meyer <seb.meyer using fau.de> wrote:
>
> To fix method lookup for R >= 3.6.0, you can use delayed S3 method
> registration along the lines of:
>
> if (getRversion() >= "3.6.0") {
>   S3method(pkg::gen, cls)
> }

And to add this automatically to your NAMESPACE with roxygen2, you may
use the following:

#' @rawNamespace if(getRversion() >= "3.6.0") {
#'   S3method(pkg::gen, cls)
#' } else {
#'   export(gen.cls)
#' }

See, e.g., https://github.com/r-quantities/errors/blob/master/R/misc.R#L243

Iñaki



More information about the R-package-devel mailing list