Documenting how a dataset was generated increases reproducibility. In addition, documentation for dataset generation can serve as a template for people to create their own datasets in a similar structure, serving as a way to bootstrap new analyses. R packages often use the data-raw directory to create datasets, but do not have an easy mechanism for importing those creation steps into dataset documentation. {exdata} provides a new roxygen2 tag to automatically copy over the dataset generation code from the scripts that create the dataset into the documentation for the dataset.
You can install exdata from GitHub with:
if (!requireNamespace('remotes', quietly = TRUE) {
install.packages('remotes')
}
remotes::install_github('mojaveazure/exdata')