mch*_*hen 5 methods r package reference-class
我setRefClass用来创建类,因为它是methods包的一部分,所以我认为您需要将此依赖项声明为import.
但是,以下最小示例Rcmd.exe check在importing时失败methods:
#' @docType package
#' @import methods
A <- setRefClass("A")
Run Code Online (Sandbox Code Playgroud)
出现以下错误(我的包被称为Test):
==> Rcmd.exe check Test_1.0.tar.gz
<Lots of checks here...>
* checking package dependencies ... ERROR
Namespace dependency not required: 'methods'
See the information on DESCRIPTION files in the chapter 'Creating R
packages' of the 'Writing R Extensions' manual.
Exited with status 1.
Run Code Online (Sandbox Code Playgroud)
因此,据我所知,似乎有人告诉我删除importformethods并因此隐藏包对methods. 我的解释是否正确,如果正确,为什么要隐藏对 的依赖methods?
我的设置: