相关疑难解决方法(0)

如何正确记录S4"["和"[< - "方法使用roxygen?

下面我发布了一个迷你示例,其中我想“[“为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)

r roxygen s4

18
推荐指数
3
解决办法
2830
查看次数

标签 统计

r ×1

roxygen ×1

s4 ×1