I am using
methods::is() in a package.
R CMD check does not seem to agree with it.
If I use
no visible global function definition for ‘is’ Consider adding importFrom("methods", "is") to your NAMESPACE file (and ensure that your DESCRIPTION Imports field contains 'methods').
If I include
@importFrom methods is as suggested:
> checking package dependencies ... ERROR Namespace dependency not required: ‘methods’ See section ‘The DESCRIPTION file’ in the ‘Writing R Extensions’ manual.
I also tried
W checking dependencies in R code (2.6s) '::' or ':::' import not declared from: ‘methods’
My DESCRIPTION and NAMESPACE are generated by Roxygen2, so I assume it is properly generated.
is() seems to be the best option, but is there a way to resolve the complaints?