Skip to Main Content
1,456
Views
7
CrossRef citations to date
Altmetric
 
Translator disclaimer

ABSTRACT

R has always provided an application programming interface (API) for extensions. Based on the C language, it uses a number of macros and other low-level constructs to exchange data structures between the R process and any dynamically loaded component modules authors added to it. With the introduction of the Rcpp package, and its later refinements, this process has become considerably easier yet also more robust. By now, Rcpp has become the most popular extension mechanism for R. This article introduces Rcpp, and illustrates with several examples how the Rcpp Attributes mechanism in particular eases the transition of objects between R and C++ code. Supplementary materials for this article are available online.

Acknowledgments

The authors thank Bob Rudis and Lionel Henry for comments and suggestion on an earlier draft of this manuscript. Furthermore, the authors appreciate the improved C++ annotated function graphic provided by Bob Rudis.

Supplementary Materials

The online supplementary materials contain the code utilized in the article.

Login options

Purchase * Save for later
Online

Article Purchase 24 hours to view or download: USD 51.00 Add to cart

Issue Purchase 30 days to view or download: USD 105.00 Add to cart

* Local tax will be added as applicable