I'm using roxygen2
to document datasets for a package I'm developing. I know you can use roxygen to document a dataset, but Shane's answer ultimately suggests a hack, which while I'd rather avoid. So, my question is:
Where should I put roxygen documentation for data?
I currently have a data documentation file (anorexia.sub.roxygen
) for an anorexia dataset in my /R folder
because as far as I can tell, that's the only place roxygen2 will look for it:
#' 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
generates the documentation just fine. But, then it ADDS anorexia.sub.roxygen.R
to my Collate
field in DESCRIPTION
:
Collate:
'granova.R'
'theme-defaults.R'
'granovagg.1w.R'
'granovagg.contr.R'
'granovagg.ds.R'
'help.R'
'anorexia.sub.roxygen.R'
I guess my question is: how can I have roxygen2
- automatically generate data documentation from roxygen blocks,
- NOT add the data documentation file to the
Collate
call, AND - avoid a solution that requires a hack