Skip to content

Workflow for new functions

Denny Wang edited this page Aug 23, 2023 · 10 revisions

To add new function to the ihmeuw-demographics packages, a developer should follow these steps:

  1. Create a git feature branch for your additions
  2. Open the .Rproj file to enter a Rstudio workspace for editing the package. For more information on R projects go here.
  3. Create a new .R file in the R directory
  4. Write out your function with complete documentation and according to our style guide.
  5. Create and run tests, debug as needed.
  6. Optional: create a vignette to describe your function (or related functions), when you would use it, and some context or examples.
  7. Knit the documentation (devtools::document()).
  8. Check the package (devtools::check() or Build > Check Package).
    • Goal: 0 errors, 0 warnings, 0 notes
    • The package check includes all tests, including testing that function examples work, spell-check, formatting, and more
  9. Submit a pull request on github.
    • Get at least 1 approval, and repeat any of the above steps as appropriate.
  10. Merge your PR into the master branch. This will trigger the github action checks and evaluation of test coverage. The pkgdown site will also be automatically updated.
  11. Propagate changes to docker-base and/or docker-internal.