The goal of this article is to provide brief overview of R packages which can be useful for general purpose programming in R. I am going to update this article from time to time to add more useful packages here.
- testthat. Write unit tests for R code. Alternatives - RUnit.
- roxygen2. Auto generate package documentation from special formatted comments in-line provided with R code.
- checkmate. Package to implement fast pre-conditions checks and asserts for your code.
- logging. Package to organize consistent logging in your R scripts and packages. The package allows to specify different handlers for logging messages (e.g. to redirect them to file, database, console), different level of logging (e.g. for debug purposes or production mode).
- lintr. Static code analyzer for R. Can be integrated with testthat package to check code formatting & style to during package compilation. This allows to enforce common. Alternatives - formatR.
- argparse. Package to simplify parsing of command line arguments for R scripts.
- cyclocomp. Calculate cyclomatic complexity of R functions. Can be used to calculate count of unit tests required to cover all execution paths within function.
- covr. Calculates test coverage for R functions.
- TypeInfo. Prototype R package to specify types for function parameters & return values. This may be a good way to fight problems with R weak typing.