【发布时间】:2011-10-28 13:05:13
【问题描述】:
我正在使用roxygen2 来记录我正在开发的包的数据集。我知道你可以use roxygen to document a dataset,但Shane's answer 最终建议进行黑客攻击,虽然我宁愿避免。所以,我的问题是:
我应该将 roxygen 文档放在哪里?
我目前有一个厌食症数据集 in my /R folder 的数据文档文件 (anorexia.sub.roxygen)
因为据我所知,这是 roxygen2 唯一会寻找它的地方:
#' Family Treatment Weight change data for young female anorexia patients.
#'
#'
#' The MASS package includes the dataset \code{anorexia}, containing pre and
#' post treatment weights for young female anorexia patients. This is a subset
#' of those data, containing only those patients who received Family Treatment.
#'
#'
#' @name anorexia.sub
#' @docType data
#' @format A dataframe with 17 observations on the following 2 variables, no
#' NAs.
#'
#' \describe{
#'
#' \item{list("Prewt")}{Pretreatment weight of subject, in pounds.}
#'
#' \item{list("Postwt")}{Postreatment weight of subject, in pounds.}
#'
#' }
#' @references Venables, W. N. and Ripley, B. D. (2002) Modern Applied
#' Statistics with S. Fourth edition. Springer.
#' @source Hand, D. J., Daly, F., McConway, K., Lunn, D. and Ostrowski, E. eds
#' (1993) A Handbook of Small Data Sets. Chapman & Hall, Data set 285 (p.
#' 229)
#' @keywords datasets
NULL
roxygen2 生成文档就好了。但是,然后它会将anorexia.sub.roxygen.R 添加到DESCRIPTION 中我的Collate 字段中:
Collate:
'granova.R'
'theme-defaults.R'
'granovagg.1w.R'
'granovagg.contr.R'
'granovagg.ds.R'
'help.R'
'anorexia.sub.roxygen.R'
我想我的问题是:我怎样才能拥有 roxygen2
- 自动从 roxygen 块生成数据文档,
- 不要将数据文档文件添加到
Collate调用中,并且 - 避免requires a hack 的解决方案
【问题讨论】: