文档对象中的非文件包锚定 link(s)

Non-file package-anchored link(s) in documentation object

在我的 R 包检查中,我收到了一些关于文档 links 的警告。

* checking Rd cross-references ... WARNING
Non-file package-anchored link(s) in documentation object 'show_sig_consensusmap.Rd':
  ‘[NMF:consensusmap]{NMF::consensusmap}’

Non-file package-anchored link(s) in documentation object 'show_sig_number_survey2.Rd':
  ‘[NMF]{summary}’

很奇怪这种警告只出现在debian中OS。

package sigminer_1.0.7.tar.gz does not pass the incoming checks automatically, please see the following pre-tests:
Windows: <https://win-builder.r-project.org/incoming_pretest/sigminer_1.0.7_20200616_163758/Windows/00check.log>
Status: OK
Debian: <https://win-builder.r-project.org/incoming_pretest/sigminer_1.0.7_20200616_163758/Debian/00check.log>
Status: 1 WARNING

我只能通过删除 link 来消除此警告。但是删除后,我的用户将无法通过单击 link.

获取更多信息

有更好的解决方案吗?

看来,如果您使用 link 形式的 \code{\link[pkg]{foo}} 指向包含多个功能的帮助页面,那么 link 应该只指向核心功能。

例如,假设函数 foo_1foo_2 在同一个帮助页面中描述,并且 foo_1 是主要函数(即出现在帮助的左上角页)。

要创建 link 到 foo_2,您应该使用 \code{\link[pkg:foo_1]{foo_2}}

参见 this GH issue and this reference 编写 R 扩展。