The goal of comoDTC is to provide an R package version of https://github.com/bogaotory/comoOdeCpp
You can install the released version of comoDTC from CRAN with:
install.packages("comoDTC")
This is a basic example which shows you how to solve a common problem:
library(comoDTC)
## basic example code
The comoDTC package is under active development. If you find a bug or have ideas about new features, please open an issue.
If you've not created an R package before and would like to contribute, we'd recommend reading the whole game chapter of Wickham and Bryan. In developing this package, we encourage contributors to use the usethis
package (discussed within the chapter), since it automates many of the commonly required workflows like:
usethis::use_r("my-func")
then calling usethis::use_test()
usethis::use_data(x)
where x
is a data file we'd like to put in the packageusethis::use_package("example-R-package")
We ask that contributions to comoDTC follow the following workflow:
i[issue number]-[approximate issue name]
. For example, the "Create contributing docs issue" that was the basis for this change was issue #8, so the branch is named i8-contributing-docs
lintr::lint_package()
devtools::check()
To check the validity of the code, we run a series of tests that (amongst other things):
devtools::document()
to build documentation locally before submitting code to the repo (which requires that you have devtools
installed via install.packages("devtools")
. Note also that if you make a change to the README.md
file, you'll need to knit the document using knitr::knit("README.Rmd")
tests
directoryAll of these tests can be run locally using devtools::check()
. It is often useful to run individual checks locally (as they're faster) when trying to address a failing test:
devtools::check_man()
checks the documentationdevtools::test()
checks that the tests in the tests
directory passTo make the package easier to read for users and the large number of participants we are using the style guidelines of Hadley Wickham's The tidyverse style guide.
Compliance with this style guide can be checked for using the lintr
package (installed via install.packages('lintr')
) as follows:
- The R code in a file may be analysed using lintr::lint(file_path)
- The R code in a directory may be analysed using lintr::lint_dir(dir_path)
- The R code in an entire package may be analysed using lintr::lint_package(pkg_path)
or lintr::lint_package()
from the open package.
As with tests, it can be useful to lint individual files and directories worked on as this will run faster.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.