Search code examples
rpackagewarnings

How can I resolve this warning message: "Requires (indirectly) orphaned package: ‘influenceR’"?


When running devtools::check(), I receive the following warning message, but I do not know which function of my rrclust package is coming from influenceR.

❯ checking package dependencies ... WARNING

Requires (indirectly) orphaned package: ‘influenceR’

I tried to add influenceR in the Suggests: section of the DESCRIPTION, but the same message keeps appearing.


Solution

  • The warning is legitimate, you might contact the maintainer of the DiagrammeR package to request a fix.

    To know how to contact them you can go the CRAN page : https://cran.r-project.org/web/packages/DiagrammeR/index.html

    There you see a field BugReports with the url of a GitHub repo so this is where you might post your issue.

    Now if you need a quick fix, it might work to use a "Suggests" dependency rather than "Imports", in the DESCRIPTION file.

    Then in each function that calls {DiagrammeR} you should add something like :

    if (!requireNamespace("DiagrammeR", quietly = TRUE)) {
      stop("The package {DiagrammerR} is required for this action")
    }
    

    Or the rlang close equivalent :

    if (!rlang::is_installed("DiagrammeR")) {
      stop("The package {DiagrammerR} is required for this action")
    }
    

    I suspect this will work because {dm} suggests {DiagrammeR} and doesn't have these issues as far as I know. The additional advantage is that users who don't have DiagrammeR installed or don't want to install it will still be able to enjoy the not diagram drawing functions of your package.