Using C++, calling C++ from R, and Creating R packages

A standard approach to implementing computationally-intensive statistical analyses and methods (including in R packages) is to code the intensive portion of the computation in C++ and call this from R. In addition, a standard way to distribute the implementation of a statistical method is as an R package available through CRAN. This tutorial and accompanying demo code provides an introduction to C++ for statisticians, with a focus on calling C/C++ code from R, as well as an introduction to creating R packages.