使用roxygen2将多个数据集文档化在一个文档对象中

3
我需要一个与@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将文档页面与数据对象关联起来,但没有在使用部分引用对象。但我相信有一种更合适的方法来完成这个任务?


1
http://r-pkgs.had.co.nz/man.html#multiple-man - undefined
2个回答

9
使用@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"

0
根据antoine-sac提供的链接r-pkgs.had.co.nz/man.html#multiple-man,正确的格式如下:
#' Tree Distances
#' 
#' These datasets contain the distances between sets
#' of 10-tip, 11-tip and 12-tip trees.
#' 
#' @name treeDistances
#' @keywords datasets
NULL 

#' @rdname treeDistances
"treeDistances10"
#' @rdname treeDistances
"treeDistances11"
#' @rdname treeDistances
"treeDistances12"

1
你可以直接记录第一个数据集,不需要使用NULL,除非你喜欢它,看我的回答 :) - undefined

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接