[英]R CMD check, WARNING, Rd cross-reference, no package available
I am running R CMD checks on my package. 我正在我的包裹上进行R CMD检查。 My command is as follows:
我的命令如下:
R CMD check --no-vignettes --no-manual --ignore-vignettes \\path\\to\\package
I am getting the following warning when checking Rd cross-references: 检查Rd交叉引用时收到以下警告:
checking Rd cross-references ... WARNING Error in find.package(package, lib.loc) : there is no package called 'cluster' Calls: <Anonymous> -> lapply -> FUN -> find.package Execution halted
The catch is that I do NOT use the cluster
package in the code. 问题是我没有在代码中使用
cluster
程序包。 It is NOT listed as a dependency in the DESCRIPTION
file. 在
DESCRIPTION
文件中未将其列为依赖项。 There is no references to cluster
in /R and /man. / R和/ man中没有对
cluster
引用。
What might be going on? 可能会发生什么?
PS Additional info: PS附加信息:
> sessionInfo()
R version 3.5.3 (2019-03-11)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows Server x64 (build 14393)
Matrix products: default
locale:
[1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252 LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C LC_TIME=English_United States.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] my_package_1.0.0 testthat_2.1.1
loaded via a namespace (and not attached):
[1] Rcpp_1.0.1 lubridate_1.7.4 prettyunits_1.0.2 assertive.properties_0.0-4
[5] assertive.types_0.0-3 assertive.data.us_0.0-2 ps_1.3.0 assertthat_0.2.1
[9] zeallot_0.1.0 rprojroot_1.3-2 digest_0.6.20 foreach_1.4.4
[13] R6_2.4.0 backports_1.1.4 assertive.code_0.0-3 pillar_1.4.2
[17] assertive.strings_0.0-3 rlang_0.4.0 rstudioapi_0.10.0-9000 data.table_1.12.2
[21] callr_3.3.0 assertive_0.3-5 assertive.data_0.0-3 desc_1.2.0
[25] devtools_2.1.0 readr_1.3.1 stringr_1.4.0 compiler_3.5.3
[29] xfun_0.8 pkgconfig_2.0.2 pkgbuild_1.0.3 tidyselect_0.2.5
[33] tibble_2.1.3 roxygen2_6.1.1 assertive.sets_0.0-3 codetools_0.2-16
[37] crayon_1.3.4 dplyr_0.8.3 withr_2.1.2 commonmark_1.7
[41] assertive.base_0.0-7 magrittr_1.5 assertive.models_0.0-2 cli_1.1.0
[45] stringi_1.4.3 fs_1.3.1 assertive.matrices_0.0-2 remotes_2.1.0
[49] doParallel_1.0.14 xml2_1.2.0 assertive.reflection_0.0-4 assertive.datetimes_0.0-2
[53] vctrs_0.2.0 iterators_1.0.10 RODBC_1.3-15 tools_3.5.3
[57] glue_1.3.1 purrr_0.3.2 assertive.numbers_0.0-2 hms_0.5.0
[61] processx_3.4.0 pkgload_1.0.2 parallel_3.5.3 assertive.files_0.0-2
[65] assertive.data.uk_0.0-2 sessioninfo_1.1.1 memoise_1.1.0 knitr_1.23
[69] usethis_1.5.1
UPDATE: edited my original post. 更新:编辑了我的原始帖子。
TLDR: make sure there is no empty package directories in your library. TLDR:确保库中没有空的软件包目录。
I spent some time digging deeper into the issue, and here is what's going on. 我花了一些时间更深入地研究问题,这是正在发生的事情。
As part of the R Rd cross-reference check, the following code statement are executed (some functions from the tools package are used): 作为R Rd交叉引用检查的一部分,将执行以下代码语句(使用了工具包中的某些功能):
base <- unlist(tools:::.get_standard_package_names()[c("base", "recommended")],
use.names = FALSE)
base <- base[dir.exists(file.path(.Library, base))]
aliases <- lapply(base, tools:::Rd_aliases, lib.loc = NULL)
The base
variable contains a list of base and recommended packages from the CRAN distribution. base
变量包含CRAN发行版中基本软件包和推荐软件包的列表。 You can learn on what these are here (go to 5.1): 您可以在此处了解这些内容(转到5.1):
https://cran.r-project.org/doc/FAQ/R-FAQ.html#R-Add_002dOn-Packages https://cran.r-project.org/doc/FAQ/R-FAQ.html#R-Add_002dOn-Packages
tools:::.get_standard_package_names()
actually returns a hard-coded list of base and recommended packages. tools:::.get_standard_package_names()
实际上返回基本和推荐软件包的硬编码列表。 Then, packages that are not present in the default system library location are eliminated. 然后,将消除默认系统库位置中不存在的软件包。 After that,
tools:::Rd_aliases
is applied to this list. 之后,将
tools:::Rd_aliases
应用于此列表。 In my case, there was a folder called cluster
in the location output by .Library
. 在我的情况下,
.Library
输出的位置中有一个名为cluster
的文件夹。 At the same time, the package itself was missing. 同时,包装本身不见了。 This is why I was getting the error.
这就是为什么我得到错误。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.