Extending <italic>R</italic> with C++: A Brief Introduction to Rcpp.

R has always provided an application programming interface (API) for extensions. Based on the <italic>C</italic> 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. Wit...

Descripción completa

Detalles Bibliográficos
Publicado en:American Statistician Vol. 72; no. 1; pp. 28 - 37
Autores principales: Eddelbuettel, Dirk, Balamuta, James Joseph
Formato: Artículo
Publicado: Taylor & Francis Ltd Feb2018
Materias:
Acceso en línea:Ver este registro en EBSCOhost
Descripción
Sumario:R has always provided an application programming interface (API) for extensions. Based on the <italic>C</italic> 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 <italic>Rcpp</italic> package, and its later refinements, this process has become considerably easier yet also more robust. By now, <italic>Rcpp</italic> has become the most popular extension mechanism for R. This article introduces <italic>Rcpp</italic>, and illustrates with several examples how the <italic>Rcpp Attributes</italic> mechanism in particular eases the transition of objects between R and C++ code. Supplementary materials for this article are available online.