下面我发布了一个迷你示例,其中我想“[“为S4类的方法编写文档.有人知道如何正确记录"["使用roxygen和S4 的通用方法吗?
在建造后检查包装时我收到警告(见下文).
#' An S4 class that stores a string.
#' @slot a contains a string
#' @export
setClass("testClass",
representation(a="character"))
#' extract method for testClass
#'
#' @docType methods
#' @rdname extract-methods
setMethod("[", signature(x = "testClass", i = "ANY", j="ANY"),
function (x, i, j, ..., drop){
print("void function")
}
)
Run Code Online (Sandbox Code Playgroud)
包检查摘录:
* checking for missing documentation entries ... WARNING
Undocumented S4 methods:
generic '[' and siglist 'testClass'
All user-level objects in a package (including S4 …Run Code Online (Sandbox Code Playgroud)