我正在寻找一个等价于 @describeIn
的工具,它将允许我为多个 R 数据对象创建一个文档对象。
我曾希望是这样的:
#' Tree Distances
#'
#' These datasets contain the distances between sets
#' of 10-tip, 11-tip and 12-tip trees.
#'
#' @name treeDistances
#' @keywords datasets
"treeDistances10"
"treeDistances11"
"treeDistances12"
将生成适用于所有三个 treeDistances##
对象的单个手册页,类似于使用 @describeIn treeDistances Distances between 11-tip trees
在另一个函数中描述一个函数>。
我注意到添加 @aliases treeDistance11 treeDistance12
将文档页面与数据对象相关联,但没有引用 Usage 部分中的对象——但我相信有更合适的方法来做到这一点?
最佳答案
使用@rdname
:
#' Tree Distances
#'
#' These datasets contain the distances between sets
#' of 10-tip, 11-tip and 12-tip trees.
#' @name treeDistances
#' @keywords datasets
"treeDistances10"
#' @rdname treeDistances
"treeDistances11"
#' @rdname treeDistances
"treeDistances12"
关于r - 使用 roxygen2 在单个文档对象中记录多个数据集,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57390342/