README.md

Build Status codecov Rhinotools

Rhinotools

Experiments in CI for R

GIT basics

always useful: GitHub Guides

locally create and switch to a new branch git checkout -b branchB, just switch to an existing branch git checkout feature-a

push it to the remote with git push origin branchB:branchB or maybe git push -u origin HEAD is easier, it also sets set upstream

and merge in GitHub through a PR

Pls contribute back with PRs or Issues

Coverage

Continuous integration with Travis CI, code coverage using the covr package via codecov.

Badges obtained via links on these sites that can be added to this README.md so the status shows up right in the github page.

Configuration of both via the travis config file in the project .travis.yml. In it's most simple form that would look like:

language: r
cache: packages

r_packages:
  - covr

after_success:
  - Rscript -e 'library(covr); codecov()'

It seems possible to support multiple languages in one travis configuration using the matrix:include feature, see SO. This will be useful when supporting both R, Python and other language in the same repository.

Packaging

For R, packages are a great way to ship code, examples, tests etc. The best tutorial is the one from Hadley Wickham: R Packages.

To build and develop the package itself, use Wickham's devtools.

Cmd-SHIFT-E = complete checking of the package build

Cmd-SHIFT-B = package install

To just install and use the R package from github, use install_github("perdoperdo/rhinotools"). If the R package lives in a subdir use install_github("perdoperdo/rhinotools/R"). The vignettes contain R notebooks (Rmd files) with extensive examples. These would typically the things we expect users to extend and -hopefully- contribute back. Supporting functions/tools would be in the package itself.

Unit testing

The testthat package proves very useful for unittesting and is fully integrated with the CI pipeline. The tests live in tests/testthat and by default have names starting with 'test' and ending with '.R'.

Cmd-SHIFT-T = run tests

Check coverage locally

(TODO)

Documentation

The man files are generated with roxygen2 which provides a javadoc-style way to annotate code.

Cmd-SHIFT-D = generate doc



operdeck/rhinotools documentation built on May 25, 2019, 11:33 p.m.