在尝试创建本地R包时,我列出了一些依赖包作为Depends:
...
Description: NA
License: GPL-2
Depends:R (>= 2.15.0),
survival,
PropCIs,
boot,
msm,
reshape2
LazyData: true
Run Code Online (Sandbox Code Playgroud)
但我通过运行R CMD检查获得了这些消息:
*checking dependencies in R code ... NOTE
Packages in Depends field not imported from:
‘PropCIs’ ‘boot’ ‘msm’ ‘reshape2’ ‘survival’
These packages need to be imported from (in the NAMESPACE file)
for when this namespace is loaded but not attached.
Run Code Online (Sandbox Code Playgroud)
然后我使用手动将这些包添加到NAMESPACE文件中,但它确实有效并且在检查后自动删除了导入行.
另一个奇怪的事情是检查过程显示:
R CMD check succeeded
Run Code Online (Sandbox Code Playgroud)
但文件随后系统地/自动地消失或删除.
有人知道原因吗?
小智 18
只需在roxygen代码中添加以下行:
@import PropCIs boot msm reshape2 survival
Run Code Online (Sandbox Code Playgroud)