How to call C++ from R with ease

February 19, 2010

(This article was first published on Revolutions, and kindly contributed to R-bloggers)

At last night's meeting of the ACM Student Chapter at the University of Chicago, DIrk Eddelbuettel gave an invited guest lecture, "Programming with Data: Using and Extending R". I wasn't there myself, but Dirk has already posted his slides, and they're a treat. After a backgrounder on R itself (BTW, I'm flattered he referenced my Introduction to R talk here), Dirk dives into some case studies on various ways to call C, C++ and Fortran code from R. Most of the time is spent on the Rcpp interface (by Dirk and Romain François), which greatly simplifies the process of writing C++ code to be called from R. You can even "inline" C++ code directly in your R program, freeing you from the need to write complete C++ source files, and compile and link the code yourself. Dirk presents some impressive performance gains from using this technique. 

[Update 9:42am: Attribution of Rcpp]

Dirk Eddelbuettel / Thinking Inside the Box: U of C ACM talk

To leave a comment for the author, please follow the link and comment on his blog: Revolutions. offers daily e-mail updates about R news and tutorials on topics such as: visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...

If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...

Tags: ,

Comments are closed.