如何解决此警告消息:“需要(间接)孤立包:’influenceR’”?

huangapple go评论56阅读模式
英文:

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

问题

在运行 devtools::check() 时,我收到以下警告消息,但我不知道我的 rrclust 包中哪个函数来自于 influenceR

❯ 检查包依赖项... 警告

要求(间接)孤立的包:‘influenceR’

我尝试将 influenceR 添加到 DESCRIPTIONSuggests: 部分,但仍然出现相同的消息。

英文:

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.

答案1

得分: 2

{influenceR} 间接地通过其他包,至少是通过您的仓库使用的 {utils} 和 {stats} 等包,被许多包所建议:

tools::dependsOnPkgs('influenceR', recursive = TRUE,
                     dependencies = 'all') |
length()
## [1] 724

在 {influenceR} 上唯一的强依赖似乎是由 {diagrammeR} 引起的:

tools::dependsOnPkgs('influenceR', recursive = TRUE, dependencies = 'strong')
## [1] "DiagrammeR"

...因此,间接依赖可能发生在您的代码中的 plotprint 功能之间。

英文:

{influenceR} is suggested, at least indirectly via other packages, by a plethora of packages of which your repo uses {utils} and {stats}: *

tools::dependsOnPkgs('influenceR', recursive = TRUE,
                     dependencies = 'all') |>
length()
## [1] 724

The only strong dependence on influenceR seems to be incurred by {diagrammeR}:

> tools::dependsOnPkgs('influenceR', recursive = TRUE, dependencies = 'strong')
## [1] "DiagrammeR"

... so the indirect dependency perhaps happens somewhere among the plot or print functionalities in you code.

* as listed with list.functions.in.file() from {NCmisc}

答案2

得分: 2

警告是合理的,您可以联系DiagrammeR软件包的维护者以请求修复。

要了解如何联系他们,您可以访问CRAN页面:https://cran.r-project.org/web/packages/DiagrammeR/index.html

在那里,您会看到一个名为BugReports的字段,其中包含GitHub仓库的URL,这就是您可以发布问题的地方。

现在,如果您需要快速修复,可以尝试在DESCRIPTION文件中将"Suggests"依赖项替换为"Imports",然后在调用{DiagrammeR}的每个函数中添加类似以下内容的代码:

if (!requireNamespace("DiagrammeR", quietly = TRUE)) {
  stop("此操作需要包{DiagrammeR}")
}

或者使用rlang的类似代码:

if (!rlang::is_installed("DiagrammeR")) {
  stop("此操作需要包{DiagrammeR}")
}

我怀疑这将有效,因为{dm}建议{DiagrammeR},据我所知,并没有这些问题。额外的好处是,没有安装DiagrammeR或不想安装它的用户仍然可以享受您的软件包的非绘图功能。

英文:

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.

答案3

得分: 1

"@I_O is right. diagrammeR 依赖于 influenceR,而 influenceR 不再有维护者,详见这里:https://cran.r-project.org/web/packages/influenceR/index.html

CRAN 声称 influenceR 的最新版本仅在不到 2 周前发布。我建议联系作者,考虑到很多人使用 diagrammeR,我会联系 diagrammeR 的作者。他近年来在 R 的 Twitter 上非常活跃并乐于提供帮助。"

英文:

@I_O is right. diagrammeR depends on influenceR which does not have a maintainer anymore, see here: https://cran.r-project.org/web/packages/influenceR/index.html

CRAN claims the latest version of influenceR was just published not even 2 weeks ago. I suggest to contact the author, given that quite a few people use diagrammeR I'd contact the author of diagrammeR. He has been active and very helpful on R twitter in recent years.

huangapple
  • 本文由 发表于 2023年5月7日 15:40:43
  • 转载请务必保留本文链接:https://go.coder-hub.com/76192715.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定