简体   繁体   English

使用 roxygen2 在单个文档对象中记录多个数据集

[英]Use roxygen2 to document multiple datasets in a single documentation object

I'm looking for an equivalent of @describeIn that will allow me to create a single documentation object for multiple R data objects.我正在寻找等效的@describeIn ,它将允许我为多个 R 数据对象创建单个文档对象。

I had hoped that something like this:我曾希望是这样的:

#' 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"

would produce a single manual page that would apply to all three treeDistances## objects, similar to describing one function within another using @describeIn treeDistances Distances between 11-tip trees .将生成一个适用于所有三个treeDistances##对象的手册页,类似于使用@describeIn treeDistances Distances between 11-tip trees来描述另一个函数中的一个函数。

I notice that adding @aliases treeDistance11 treeDistance12 associates the documentation page with the data objects, but without referencing the objects in the Usage section – but I believe that there is a more appropriate way to do this?我注意到添加@aliases treeDistance11 treeDistance12将文档页面与数据对象相关联,但没有引用使用部分中的对象 - 但我相信有更合适的方法来做到这一点?

Use @rdname :使用@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"

Following antoine-sac's link to r-pkgs.had.co.nz/man.html#multiple-man, the correct format is:按照 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"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM