【发布时间】:2016-10-18 12:50:20
【问题描述】:
在我的 R 包中,包手册 .pdf 文件中省略了一些函数 - 它们都是 S3 方法,其中几个函数一起记录。所有其他“正常”功能都正确显示,所以我怀疑我没有正确记录 S3 方法。
我希望在手册中出现myfun 的条目。现在,.pdf 手册中完全缺少该函数,尽管它仍然可以正确调用,并且它的帮助页面用?myfun 引用。我的 Roxygen2 关键字错了吗?
#' @export
myfun <- function(...) UseMethod("myfun")
#' @inheritParams myfun
#' @describeIn myfun Create a frequency table from a vector.
#' @export
#' @keywords internal
myfun.default <- function(vec, sort = FALSE, show_na = TRUE, ...) {
...
}
#' @inheritParams myfun.default
#' @describeIn myfun Create a frequency table from a data.frame,
#' supplying the unquoted name of the column to tabulate.
#' @export
#' @keywords internal
tabyl.data.frame <- function(.data, ...){
...
}
(我省略了@title, @description, @param, @return, @examples 行以使这个问题更短,但可以在相关时对其进行编辑)。
通用方法按预期导出,因此用户只能看到myfun() 而看不到myfun.default() 或myfun.data.frame(),除非他们使用三重冒号:::。我想保留这种行为,所以用户只需调用myfun,同时在包手册中也有myfun 的条目。
【问题讨论】:
-
目前,
myfun根本没有出现在手册中。我不想要myfun.default和myfun.data.frame的部分,我只想要手册中myfun的条目 - 我会在问题中更清楚地说明这一点。