Open Lovemore-Gakava opened 4 months ago
To create a Git workflow for an R package that executes data-raw
and regenerates data when a commit is done, you can follow these steps:
Initial Setup:
.gitignore
file to exclude generated data and any other unnecessary files from version control.Package Structure:
R/
, data-raw/
, and inst/
directories among others.data-raw/
directory.Set Up Scripts:
01_prepare_data.R
) inside the data-raw/
directory to generate or prepare the data for your package.inst/extdata/
or data/
).Git Hooks:
post-commit
hook, to execute your data generation script (01_prepare_data.R
) after each commit. This will ensure that the data gets regenerated automatically after a commit is made.Automation:
make
or a continuous integration (CI) tool like GitHub Actions or Travis CI. This will further streamline the process and ensure that the data regeneration happens consistently.Version Control:
By following these steps, you can create a Git workflow for your R package that not only includes version control but also automatically executes the data generation process when a commit is made. This can help maintain the consistency and reliability of the data used within your R package.
Investigate to check if there is workflow to check if data is in sync with the data-raw code.