Week 12: Rewriting R code in C++
Main reference
What you will learn this week
- C++ for applications in R with Tomasz Woźniak
- The first steps with Rcpp
- Some stats with RcppArmadillo
- Hands-on coding with four exercises
- Create an R package with compiled code in ten steps
Other references used during the session
- Armadillo library documentation
- Tsuda, M., Rcpp for everyone
Scripts used during the session
- Simple list creation
nicetry.cpp
- Simple linear regression example
nicelr.cpp
- Simple loop application
nicelist.cpp
- Sampling from inverted gamma 2 distribution
nicerig2.cpp
- Step-by-step package creation
nicepackage.R
Slides for week
Assignments
- Assignment 4 is due on Friday 24 May.