Search code examples
rdocumentationroxygen2

R and roxygen2: How to document data files in inst/extdata?


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?


Solution

  • 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