Course syllabus
The main goal of this course is to give you tools that ease (high-performing and efficient) code development with . The performance side will come as a second part, and the initial tools introduced are also very useful in situations that do not require important computation times.
We will focus the presentation of these development tools on the notion of package. You are already familiar with this notion, as you have already already installed packages from the CRAN for example ! You also know that it is the most standard way in to distribute code and make it available. We will show you that the package is also an excellent tool for developing code.
We will follow the outline below:
Build an package as a useful tool for code development
Leverage
git
for tracking changes, andGitHub
for sharing code, collaborative development, automating tests in a package and broadcast a companion websiteMeasure computation time
Profile the code
Use
Rcpp
to optimize what needs to be optimizedParallelize the code easily
Required tools
To take this course, you will need to have the following softwares installed:
the latest version of (https://cloud.r-project.org/)
the latest version of
RStudio
(https://posit.co/download/rstudio-desktop/#download)a C++ compiler (such as
gcc
orclang
- native on UNIX systems, for Windows users we recommend installing Rtools, for Mac users it may be necessary to install the macOS tool chain as detailed herethe following packages:
devtools
,future.apply
,microbenchmark
,mvtnorm
,profvis
,Rcpp
,RcppArmadillo
,roxygen2
,testthat
,usethis
the software git which can be installed following instructions from Happy Git With R by Jennifer Bryan
In addition, you will need an active internet connection (e.g.ย through eduroam)
NB: In case you have not the sufficient admin rights on your computer to install some of those tools, you can instead use the service Posit Cloud offered Posit (the company developing RStudio) signing up for their free plan. This will give you access to a remote RStudio session with all the necessary softwares available, leaving you only with the above list of packages to install.
Prerequisites
To be able to follow along this training, you must be comfortable with the following concepts:
- programming with within the
RStudio
IDE - writing functions in
- control structures, particularly for loops
-
apply
family, andsapply()
in particular - the calculation of the density for a multivariate Gaussian distribution