Skip to content
Prev 3331 / 12125 Next

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

These issues originate in a change in how R looks for S3 methods, at
least on some of the CRAN machines. To reproduce locally, you currently
need to set the environnment variable

_R_S3_METHOD_LOOKUP_BASEENV_AFTER_GLOBALENV_=TRUE

See the source code at
https://svn.r-project.org/R/trunk/src/main/objects.c

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)
}

See the manual at
https://cran.r-project.org/doc/manuals/r-devel/R-exts.html#Registering-S3-methods

Hope this helps!
Cheers,

	Sebastian


Am 08.01.19 um 04:56 schrieb Ben Bolker: