Skip to content

Contributing to dampack

Caleb Easterly edited this page Apr 19, 2019 · 6 revisions

You'll need devtools

After that, run the following code:

devtools::install_github("DARTH-git/dampack", dependencies = TRUE)

That should install all of the necessary packages to run dampack and its tests.

There are three important stages in package development, each of which you should do before changing anything:

Build

This builds the package and installs it - to the default R library, unless you specify otherwise. If you build the package locally, it will overwrite your installation from Github.

Each time you make a change in your package, you have to rebuild it for the changes to be reflected in the loaded package.

In RStudio, the easiest way to build the package is by clicking the "Install and Restart" button in the Build pane, or by pressing Ctrl + Shift + B (windows) or Cmd + Shift + B (mac).

Some changes to the Build settings can make the process simpler. Click on the "More" drop-down menu in the Build pane, then "Configure Build Tools". Check "Use devtools package functions if available" and "Generate documentation with Roxygen". Then click "Configure" next to the word Roxygen - below "Automatically roxygenize...", check all 3 options. Now, the documentation will be rebuilt every time you build the package, so you don't have to build the documentation separately.

Test

After building the package, you can run all of the unit tests in the package with Ctrl/Cmd + Shift + T. This should identify any installation or computing environment errors.

Check

Another step in CRAN deployment is package checking. CRAN requires that all submitted packages pass a series of tests. To "check" the package, click "Check" or type Ctrl/Cmd + Shift + E.

Contributing

When making a change, it's important to ensure that your changes don't break anything. So, it's recommended to run each of the three steps above after each major change. If something breaks, fix it!

Clone this wiki locally