knitr::opts_chunk$set( collapse = TRUE, comment = "#>", echo = TRUE, eval = FALSE )
Regular automated checks of your module code help ensure your module can be run by others and that no errors are introduced when you make a change to your code. Users hosting module code in GitHub repositories can take advantage of free GitHub Actions minutes to automatically run their module.
NOTE: Long-running or memory-intensive code should not be run. GitHub actions limits code execution.
Since we encourage all module authors to maintain a high-level overview of their module in a
.Rmd file, this can be used to demonstrate use of the module, as as well as test that the module can be run without error.
By default, the automated testing of the module is done by running (i.e., rendering) the module's
When creating a new module, simply specify
useGitHub = TRUE to generate the necessary GitHub Actions configuration file.
For existing modules, use
use_gha(name = 'moduleName', path = 'modulePath') to add the GitHub Actions testing workflow.
You can modify your module's workflow file (
.github/workflows/render-module-rmd.yaml) to suit your specific needs.
Some packages may require installation of additional system dependencies.
The workflow file contains a section named Install GDAL and other dependencies, which can be updated to include additional system packages.
To determine which additional packages need to be installed, use
For example, to determine the system dependencies required for the
usefulFuns package (from GitHub), get the package code and determine what additional system packages need to be installed.
$ git clone https://github.com/PredictiveEcology/usefulFuns
$ cd usefulFuns
$ Rscript -e 'remotes::system_requirements("ubuntu", "18.04")'
 "apt-get install -y libcurl4-openssl-dev"
 "apt-get install -y libssl-dev"
 "apt-get install -y imagemagick"
 "apt-get install -y libmagick++-dev"
 "apt-get install -y texlive"
 "apt-get install -y swftools"
 "apt-get install -y zlib1g-dev"
 "apt-get install -y make"
 "apt-get install -y libfreetype6-dev"
 "apt-get install -y libpng-dev"
 "apt-get install -y libicu-dev"
 "apt-get install -y libglpk-dev"
 "apt-get install -y libgmp3-dev"
 "apt-get install -y libxml2-dev"
 "apt-get install -y libgdal-dev"
 "apt-get install -y gdal-bin"
 "apt-get install -y libproj-dev"
 "apt-get install -y libgeos-dev"
 "apt-get install -y libjpeg-dev"
 "apt-get install -y git"
 "apt-get install -y libudunits2-dev"
 "apt-get install -y pandoc"
Note that this does not currently capture system dependencies from packages in the
Remotes field of the
However, a separate call to those packages will get them.
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.