Useful stuff to know with R

This website is outdated.
Please go to

Using C/C++ code with R

To speed up R, it might be interesting to use some C or C++ code. Some references:

• Peng, R.D. and Leeuw, J. (2002) An introduction to the .C Interface to R. UCLA Department of Statistics
• Baillargeon, S. (2007) Programmation en R : incorporation de code C et création de packages. Université de Laval
• Spector, P. Calling R funcions from C programs. Univeristy of California, Berkeley
• R Development Core Team (2008) Writing R Extensions.

But I recommend the amazing package of Dirk Eddelbuettel and Romain François named "rcpp", available from CRAN

Optimizing R

R is using the BLAS library for linear algebra. To speed up computations, we can replace the standard BLAS that comes with R by the fast BLAS given by ATLAS (Automatically Tuned Linear Algebra Software). This is explained in Appendix A, section 3 of “R Installation and Administration” manual.

See also
• Eddelbuettel, D. (2008) Introduction to High-Performance R. UseR2008! Tutorial.
• R Development Core Team (2008) R Installation and Administration.
• Eddelbuettel, D. CRAN Task View: High Performance and Parallel Computing.

Parallel Computing

The simplest package to distribute computations over multiple cores with R is doMC.


Many useful tips are available in the blogs aggregated by R bloggers: