I have some data files that I want to distribute with a package I'm creating. I've placed the files in inst/extdata. How and where do I document these files using roxygen2?
R and roxygen2: How to document data files in inst/extdata?
Asked Answered
I'm still not sure what's best practice, but following rawr's advice this is what I did:
- Created a file R/extdata.R
- Documented each file I have in inst/extdata like this:
(Ignore this line: Apparently I need some text here so that what's below turns into a code block.)
#' Dataset foo
#'
#' This is a dataset containing stuff.
#'
#' @name raw_datasetName
#'
#' @section datasetName.csv:
#'
#' This data is used in thisFunction().
NULL
© 2022 - 2024 — McMap. All rights reserved.
/data
except give it a@name raw_data1
to reference and aNULL
value instead of"raw_data1"
– CaponR/data.R
? Is this correct? How do I reference the filename I have ininst/extdata
? – Trickster?raw_myDataset
to bring up that help page. I'm not sure what you mean by reference it. you can get the file path withsystem.file('extdata','raw_data1.csv', package = 'your_package')
, is that what you mean? – Caponinst/extdata
that I'm documenting? If my dataset isinst/extdata/rollerblades.csv
, something like this? – Tricksterdata/rollerblades.Rdata
? – Capon