Use roxygen2 to document multiple datasets in a single documentation object
Asked Answered
J

1

5

I'm looking for an equivalent of @describeIn that will allow me to create a single documentation object for multiple R data objects.

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.

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?

Jasmin answered 7/8, 2019 at 8:43 Comment(1)
r-pkgs.had.co.nz/man.html#multiple-manLitigate
L
12

Use @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"
Litigate answered 7/8, 2019 at 8:57 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.