[英]R CHECK WARNING: Requires Orphaned Package
Recently I built an R package and wanted to publish it in CRAN.最近我构建了一个 R package 并想在 CRAN 中发布它。 I had checked it in my local machine (WIN10 R>=3.6) and it showed there was 0 WARNING, 0 NOTE and 0 ERROR.
我在我的本地机器(WIN10 R>=3.6)中检查过它,它显示有 0 WARNING、0 NOTE 和 0 ERROR。 Then I uploaded it to the CRAN.
然后我把它上传到 CRAN。 However, the CRAN CHECK showed that I had one WARNING in LINUX: here is the raw log.
但是,CRAN CHECK 显示我在 LINUX 中有一个警告:这是原始日志。
Flavor: r-devel-linux-x86_64-debian-gcc
Check: package dependencies, Result: WARNING
Requires orphaned package: 'flare'
The package flare
is in the "Imports". package
flare
在“进口”中。 I checked the R POLICIES and found it said "Orphaned CRAN packages should not be strict requirements".我检查了 R POLICIES 并发现它说“孤立的 CRAN 包不应该是严格的要求”。 However, if I change the dependency to "Suggests", I cannot use the function
slim
in the package flare
.但是,如果我将依赖项更改为“建议”,则无法在 package
flare
中使用 function slim
。 How can I adjust it so that I can pass the CRAN CHECK?如何调整它以便通过 CRAN CHECK?
The standard use of a package in Suggests:
is to test it before you use it. Suggests:
package 的标准用法是在使用之前对其进行测试。 So for a function bar()
from package foo
, change your code from因此,对于来自 package
foo
的 function bar()
,将您的代码从
res <- bar(a,b,c) # foo in NAMESPACE as imports
to至
res <- NA
if (requireNamespace("foo", quietly=TRUE) {
res <- foo::bar(a,b,c) # package foo in Suggests
} else {
warning("Would need foo for bar") # message optional
}
There is no other way to appease the CRAN check.没有其他方法可以安抚 CRAN 检查。 (Besides adopting the orphaned package but that is a whole different ball game.)
(除了采用孤立的 package 但那是完全不同的球赛。)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.