Skip to content

rcmdcheck fails on the suggested package #245

@zivankaraman

Description

@zivankaraman

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions