I am experiencing an issue with rcmdcheck related to a suggested package.
My R package includes a package (let's call it pkgX) in the Suggests field.
There is one function in my package that relies on a function from pkgX.
The code follows the guidance provided in the R manual:
if (requireNamespace("pkgX", quietly = TRUE)) {
pkgX::some_function(...)
...
} else {
# Do something else that does not involve pkgX
stop("pkgX is required here.")
}
However, when I run rcmdcheck, it fails, indicating that the package pkgX is not listed in Depends or Imports.
I previously ran rcmdcheck on the same code several months ago, and it did not fail then.
Is this a feature or a bug?
I am experiencing an issue with
rcmdcheckrelated to a suggested package.My R package includes a package (let's call it
pkgX) in the Suggests field.There is one function in my package that relies on a function from
pkgX.The code follows the guidance provided in the R manual:
However, when I run
rcmdcheck, it fails, indicating that the packagepkgXis not listed in Depends or Imports.I previously ran
rcmdcheckon the same code several months ago, and it did not fail then.Is this a feature or a bug?