essential-R
essential-R copied to clipboard
:blue_book: Essential tools and libraries for programming in R
Essential R
:rocket: Essential tools and libraries for programming in R
About
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.
R package development
A minimum R-package stack at least consists of the following packages of tools:
goodpracticefor advice on writing R packagesdevtoolsfor general package developmenttestthatfor unit testingroxygen2for method documentationcovrto generate coverage reportslintrfor static code analysisstylerto automatically format codeusethisfor automation of repetitive tasks during developmentremotesto install R packages from Git repositories, CRAN and Bioconductorpkgdownto generate websites of your packagercmdcheckto check your package within Rprofvisto visualize profiling databenchto time R expressionsmicrobenchmarkto also time R expressionslobstrto pry open Rhereto find files and folders
Many more can be find on github at r-lib or rstudio.
Programming
purrrfor functional programmingmagrittrfor pipeing function callsR6for object-oriented programming with encapsulationRcpp(withRcppArmadillo,RcppEigenandBH) for integration of C++ codereticulatefor interfacing to Pythoncpp11as alternative (and complement) to Rcppcompiler,doParallel,parallel,foreachfor speeding up Rrlangas low-level API for programming in R
C++
mesonas modern build system andautotoolssince R is oldVTuneand the Parallel Studio to profile codeCallgrindas an alternative to the abovegdbandlldbfor debugging C++sanitizersto detect memory leaks, etc.cppcheckfor static code analysiscpplintto check C++ styleclang-formatto format C++ filesdoxygenfor code documentationboostfor 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
Working with data
tidyverse(dplyr,tidyr, ...) for working with data in generaldata.tableas a fast alternative to R`s native data framedatastructuresfor advanced data structuresdbplyrto work with data basesRSQLiteto work with SQLite data bases
Machine learning and Bayesian statistics
rstanto fit Bayesian modelscmdstanras light-weight interface tocmdstanrstanarmfor applied regression modelingbrmsfor multilevel modelsbayesplotto visualize Bayesian inferencesloofor approximate LOO-CV and PSISprojpredfor projection predictive variable selectionrstantoolsfor developing R Packages interfacing with Stanposteriorfor working with output from Bayesian modelscodafor summarizing and working with MCMC outputMCMCpackprovides some utility functionsLaplacesDemonfor even more Bayes utilitymgcvfor generalized additive mixed modelstensorflowfor numerical computationtfprobabilityfor statistical computation and probabilistic modelingkerasto work with neural networkssparklyrfor big data processingkernlabfor kernel-based machine learning
Graphical models and causal inference
bnlearnfor BN structure learningpcalgfor causal inference using graphical modelsggdagfor visualizing DAGsdagittyfor analysis of structural equation models
Optimization
Visualization
ggplot2as base package for visualizationpaletteerfor all the palettesvapoRwavefor even more palettesgpubrfor publication ready visualizationggthemesfor additional themes and scales for ggplot2hrbrthemesfor even more themesggscifor sci-fi themesggthemrfor even mroe themescolourloversfor access to the COLOURlovers APIpatchworkto easily compose plotscolorspacefor color manipulationcowplotfor plot annotationsscalesandswatchesplotlyfor interactive plotsggraphto visualize graphsgganimateto animate plotsDiagrammeRfor diagrammes, graphs and networkshighcharteras alternative toplotlytidybayesfor geoms for Bayesian modelsscicofor more color palettesggnetworkfor geoms for networkstweenrto interpolate datamagickto work with imagesimageras complement tomagickr2d3to interface tod3
Reporting
shinyfor interactive web applicationsrmarkdownto generate websites, pdf documents, etc from markdown filesbookdownfor authoring bookstuftefor Tufte-style documentsxaringanfor HTML presentations
Other
Author
Simon Dirmeier [email protected]
License

This work by Simon Dirmeier is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.