用roxygen2记录数据帧列表



我正在尝试记录一些我附加在我的包中的数据。

我有一个有3个元素的列表(data.frames),每个数据帧都有一些列。我想知道如何在roxygen2中记录这个层次结构(list -> data.frame -> column)。示例总是只显示一个层,data.frame和列名。下面是一个最小的例子,在一个列表中有两个数据帧。

list(
  names=data.frame(id=1:10, a=letters[1:10]),
  values=data.frame(id=rep(1:10, each=10), values=runif(100))
)

在我的列表中,所有三个数据帧都连接到一个id列,所以它们是相关的,但我不想把它们放在一个数据帧中,因为节省内存。

欢迎提出任何建议。

编辑

我试图添加段到我的文档,但这似乎不工作

#' List with group information for the test data set
#'
#' This dataset is a list with 2 data.tables (proteins, timepoint). 
#' It has a common id column in all data.tables.
#'
#' strong{proteins}
#' @format A data frame with 5458 rows and 3 columns
#' describe{
#'   item{id}{unique group id}
#'   item{names}{individual names}
#'   item{other names}{other names}
#' }
#'
#' strong{timepoint}
#' @format A data frame with 80248 rows and 5 columns
#' describe{
#'   item{id}{unique group id}
#'   item{timepoint}{individual timepoint}
#'   item{imputed_mean}{mean value including imputed values}
#'   item{measured_mean}{mean value without imputing (contains NAs)}
#'   item{value_count}{number of measured values within the replicates}
#' }
'pg_test'

输出看起来只能处理1个@format参数

还有其他建议吗?

事实上,我刚刚想出了一个解决方案,只要没有其他人有更好的建议…

#' List with group information for the test data set
#'
#' This dataset is a list with 2 data.tables (proteins, timepoint). 
#' It has a common id column in all data.tables.
#'
#' @format 
#' enumerate{
#' item strong{proteins} A data frame with 5458 rows and 3 columns
#' describe{
#'   item{id}{unique group id}
#'   item{names}{individual names}
#'   item{other names}{other names}
#' }
#'
#' item strong{timepoint} A data frame with 80248 rows and 5 columns
#' describe{
#'   item{id}{unique group id}
#'   item{timepoint}{individual timepoint}
#'   item{imputed_mean}{mean value including imputed values}
#'   item{measured_mean}{mean value without imputing (contains NAs)}
#'   item{value_count}{number of measured values within the replicates}
#' }
#' }
'pg_test'

也可以用

求解
#' describe{
#'   item{One}{First item}
....
我猜是

而不是enumerate

最新更新