# Leveraging High Performance Compiled Code in R with Rcpp

## Meeting Recap

Paul Egeler and Dr. David Zeitler talked about Dirk Eddelbuettel’s extremely popular Rcpp package for leveraging C++ code in R. It is used by over 1000 CRAN packages and almost 100 Bioconductor packages. It can be an excellent tool to help speed up bottlenecks in R workflows.

Using complied C++ code in R scripts and packages using the Rcpp API is a great way to alleviate pain points in slow-running code. Paul and David talked about situations when it may be appropriate to consider using C++ code. They also discussed the relative performance of C++ code as compared to both poorly-optimized R code as well as highly-optimized R code.

Paul gave a short primer on the concepts of C++ and compiled code. He went over basic C++ syntax and how to transform source code to a binary executable file using a *compiler*. He also went over the basic usage of Rcpp both in an R script and in a package. Meeting materials can be seen here.

Dr. Zeitler went over some of the linear algebra libraries available for C++, including Armadillo and Eigen. Many of these linear algebra libraries have Rcpp packages of their own that allows near-seamless usage in R. Dr. Zeitler used several linear algebra use-cases to compare performance of the various libraries.

## Vocabulary ExpandR Challenge

We started a new participation challenge. We are asking WMRUG members to give a short 10 minute talk about a function that should be in every R programmer’s toolkit. Do you use a lot of `dplyr::left_join()`

? What about `stats::ftable()`

? Even seemingly simple functions like `cat()`

or `dput()`

or `ls()`

? Tell us about it!

**Did I mention participants get FREE CANDY or FREE COFFEE?**

Derek Nedveck was kind enough to kick the challenge off with his talk about `base::Reduce()`

. Thanks Derek!