I'm making a package that includes two datasets, one being the translation in a different language of the other. I'd like to document both datasets in the same file.
I'm wondering what is the recommend approach to document the @format
tag in this case. The only thing that differs are variable names. Is it preferred to have one @format
for each dataset (example 1, which I find a bit redundant) or to have the different variables and their respective translations in the same item (example 2)? Or simply say in e.g. @details
that variables in bar2
are translations from variables in bar1
?
example 1:
#' @title Foo
#' @description blah blah
#' @name foo
#' @examples
#' bar1
#' bar2
NULL
#' @rdname foo
#' @format A tibble with x rows and y variables:
#' \describe{
#' \item{variable1}{description of variable1}
#' \item{variable2}{description of variable2}
#' }
"bar1"
#' @rdname foo
#' @format A tibble with x rows and y variables:
#' \describe{
#' \item{translated_variable1}{description of variable1}
#' \item{translated_variable2}{description of variable2}
#' }
"bar2"
example 2:
#' @title Foo
#' @description blah blah
#' @format A tibble with x rows and y variables:
#' \describe{
#' \item{variable1,translated_variable1}{description of variable1}
#' \item{variable2,translated_variable2}{description of variable2}
#' }
#' @name foo
#' @examples
#' bar1
#' bar2
NULL
#' @rdname foo
"bar1"
#' @rdname foo
"bar2"