Skip to contents

Contributions are welcome from the community. Questions can be asked on the issues page of this repo. Before creating a new issue, please take a moment to search and make sure a similar issue does not already exist. If one does exist, you can comment (most simply even with just a :+1:) to show your support for that issue.

If you have direct contributions you would like considered for incorporation into the project you can fork this repository and submit a merge request for review.

Package Development 101

This section discusses the basic workflow of writing R packages. See this cheat sheet for more information.

  1. Make an informatively named branch off of the main branch of this repo.

  2. Make your desired change(s).

  • If writing a new function, make sure you thoroughly document the function using roxygen2 style. If you want this function to be exported with the package, add an @export tab somewhere in the documentation (I prefer at the very end)

  • If you’re changing a function that is already documented, make sure to update any aspects of the documentation your changes make outdated.

  • Write some tests to verify the function works/breaks when it should (e.g., throws an error when incorrect arguments are passed). See the testthat package documentation for information on writing good unit tests.

  1. Re-compile the documentation with devtools::document(). This will print warnings/errors if there’s anything wrong with the documentation. This will update/create an .Rd file in the man folder.
  • Bonus: re-build the package website with pkgdown::build_site(). This will update the contents of the docs folder.
  1. Re-build the package with CTRL/CMD + SHIFT + B. Wait for the session to restart and the package to load.

  2. Run your function (in the console or wherever) and verify it works as expected.

  3. Stage, commit, and push your changes to the mortar GitLab repo. Open a merge request and add someone appropriate (e.g., the package maintainer) as a reviewer.