Skip to content
Prev 61593 / 63421 Next

Should '@" now be listed in tools:::.get_internal_S3_generics() ?

A more concrete example in order to correct my vague messages below.

Writing an R package that uses `@` and `@<-` as S3 generics. Line from manual pages in .Rd files:

    \method{@}{newclass}(object, name) <- value

Throws this error during R CMD check ?as-cran

    Bad \usage lines found in documentation object ?code?:
      <unescaped bksl>method{@}{newclass}(object, name) <- value

This error is due to tools::checkDocFiles eventually calling tools:::.S3_method_markup_regexp and not finding `@` as a valid for S3.
This error is gone if we adjust tools:::.S3_method_markup_regexp to pass for ?@? by adding ?\\@? to regexp.

Please note that this now is not dependant on using or not using roxygen2
KK.