🚀 Essential tools and libraries for programming in R
This document serves as a personal list of
- tools for package development,
- good practices for programming,
- and most frequently used packages
with an emphasis on data science, Bayesian stats and probabilistic ML.
A minimum R
-package stack at least consists of the following packages of tools:
goodpractice
for advice on writing R packagesdevtools
for general package developmenttestthat
for unit testingroxygen2
for method documentationcovr
to generate coverage reportslintr
for static code analysisstyler
to automatically format codeusethis
for automation of repetitive tasks during developmentremotes
to install R packages from Git repositories, CRAN and Bioconductorpkgdown
to generate websites of your packagercmdcheck
to check your package within Rprofvis
to visualize profiling databench
to time R expressionsmicrobenchmark
to also time R expressionslobstr
to pry open Rhere
to find files and folders
Many more can be find on github at r-lib or rstudio.
purrr
for functional programmingmagrittr
for pipeing function callsR6
for object-oriented programming with encapsulationRcpp
(withRcppArmadillo
,RcppEigen
andBH
) for integration of C++ codereticulate
for interfacing to Pythoncpp11
as alternative (and complement) to Rcppcompiler
,doParallel
,parallel
,foreach
for speeding up Rrlang
as low-level API for programming in R
meson
as modern build system andautotools
since R is oldVTune
and the Parallel Studio to profile codeCallgrind
as an alternative to the abovegdb
andlldb
for debugging C++sanitizers
to detect memory leaks, etc.cppcheck
for static code analysiscpplint
to check C++ styleclang-format
to format C++ filesdoxygen
for code documentationboost
for unit tests, data structures and basically everything you ever need
Furthermore, some good reading:
- Scott Meyers: Effective C++
- Scott Meyers: Effective Modern C++
- Scott Meyers: Effective STL
- Kurt Guntheroth: Optimized C++
- David Vandevoorde: C++ Templates - the compete guide
- Nicolai Josuttis: C++17 - the complete guide
tidyverse
(dplyr
,tidyr
, ...) for working with data in generaldata.table
as a fast alternative to R`s native data framedatastructures
for advanced data structuresdbplyr
to work with data basesRSQLite
to work with SQLite data bases
rstan
to fit Bayesian modelscmdstanr
as light-weight interface tocmdstan
rstanarm
for applied regression modelingbrms
for multilevel modelsbayesplot
to visualize Bayesian inferencesloo
for approximate LOO-CV and PSISprojpred
for projection predictive variable selectionrstantools
for developing R Packages interfacing with Stanposterior
for working with output from Bayesian modelscoda
for summarizing and working with MCMC outputMCMCpack
provides some utility functionsLaplacesDemon
for even more Bayes utilitymgcv
for generalized additive mixed modelstensorflow
for numerical computationtfprobability
for statistical computation and probabilistic modelingkeras
to work with neural networkssparklyr
for big data processingkernlab
for kernel-based machine learning
bnlearn
for BN structure learningpcalg
for causal inference using graphical modelsggdag
for visualizing DAGsdagitty
for analysis of structural equation models
ggplot2
as base package for visualizationpaletteer
for all the palettesvapoRwave
for even more palettesgpubr
for publication ready visualizationggthemes
for additional themes and scales for ggplot2hrbrthemes
for even more themesggsci
for sci-fi themesggthemr
for even mroe themescolourlovers
for access to the COLOURlovers APIpatchwork
to easily compose plotscolorspace
for color manipulationcowplot
for plot annotationsscales
andswatches
plotly
for interactive plotsggraph
to visualize graphsgganimate
to animate plotsDiagrammeR
for diagrammes, graphs and networkshighcharter
as alternative toplotly
tidybayes
for geoms for Bayesian modelsscico
for more color palettesggnetwork
for geoms for networkstweenr
to interpolate datamagick
to work with imagesimager
as complement tomagick
r2d3
to interface tod3
shiny
for interactive web applicationsrmarkdown
to generate websites, pdf documents, etc from markdown filesbookdown
for authoring bookstufte
for Tufte-style documentsxaringan
for HTML presentations
Simon Dirmeier simon.dirmeier@web.de
This work by Simon Dirmeier is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.