IDEAS home Printed from https://ideas.repec.org/a/taf/amstat/v72y2018i1p28-36.html
   My bibliography  Save this article

Extending R with C++: A Brief Introduction to Rcpp

Author

Listed:
  • Dirk Eddelbuettel
  • James Joseph Balamuta

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.

Suggested Citation

  • Dirk Eddelbuettel & James Joseph Balamuta, 2018. "Extending R with C++: A Brief Introduction to Rcpp," The American Statistician, Taylor & Francis Journals, vol. 72(1), pages 28-36, January.
  • Handle: RePEc:taf:amstat:v:72:y:2018:i:1:p:28-36
    DOI: 10.1080/00031305.2017.1375990
    as

    Download full text from publisher

    File URL: http://hdl.handle.net/10.1080/00031305.2017.1375990
    Download Restriction: Access to full text is restricted to subscribers.

    File URL: https://libkey.io/10.1080/00031305.2017.1375990?utm_source=ideas
    LibKey link: if access is restricted and if your library uses this service, LibKey will redirect you to where you can use your library subscription to access this item
    ---><---

    As the access to this document is restricted, you may want to search for a different version of it.

    References listed on IDEAS

    as
    1. Eddelbuettel, Dirk & Francois, Romain, 2011. "Rcpp: Seamless R and C++ Integration," Journal of Statistical Software, Foundation for Open Access Statistics, vol. 40(i08).
    2. Eddelbuettel, Dirk & Sanderson, Conrad, 2014. "RcppArmadillo: Accelerating R with high-performance C++ linear algebra," Computational Statistics & Data Analysis, Elsevier, vol. 71(C), pages 1054-1063.
    Full references (including those not matched with items on IDEAS)

    Citations

    Citations are extracted by the CitEc Project, subscribe to its RSS feed for this item.
    as


    Cited by:

    1. Bénard, Annaëlle & Lengagne, Thierry & Bonenfant, Christophe, 2024. "Integration of animal movement into wildlife-vehicle collision models," Ecological Modelling, Elsevier, vol. 492(C).

    Most related items

    These are the items that most often cite the same works as this one and are cited by the same works as this one.
    1. Helmut Lutkepohl & Fei Shang & Luis Uzeda & Tomasz Wo'zniak, 2024. "Partial Identification of Heteroskedastic Structural VARs: Theory and Bayesian Inference," Papers 2404.11057, arXiv.org.
    2. Battauz, Michela & Vidoni, Paolo, 2022. "A likelihood-based boosting algorithm for factor analysis models with binary data," Computational Statistics & Data Analysis, Elsevier, vol. 168(C).
    3. Jos'e Vin'icius de Miranda Cardoso & Jiaxi Ying & Daniel Perez Palomar, 2020. "Algorithms for Learning Graphs in Financial Markets," Papers 2012.15410, arXiv.org.
    4. Shen, Yunyi & Olson, Erik R. & Van Deelen, Timothy R., 2021. "Spatially explicit modeling of community occupancy using Markov Random Field models with imperfect observation: Mesocarnivores in Apostle Islands National Lakeshore," Ecological Modelling, Elsevier, vol. 459(C).
    5. Matthew Pietrosanu & Jueyu Gao & Linglong Kong & Bei Jiang & Di Niu, 2021. "Advanced algorithms for penalized quantile and composite quantile regression," Computational Statistics, Springer, vol. 36(1), pages 333-346, March.
    6. Lee, Xing Ju & Hainy, Markus & McKeone, James P. & Drovandi, Christopher C. & Pettitt, Anthony N., 2018. "ABC model selection for spatial extremes models applied to South Australian maximum temperature data," Computational Statistics & Data Analysis, Elsevier, vol. 128(C), pages 128-144.
    7. François Bachoc & Marc G Genton & Klaus Nordhausen & Anne Ruiz-Gazen & Joni Virta, 2020. "Spatial blind source separation," Biometrika, Biometrika Trust, vol. 107(3), pages 627-646.
    8. Erick da Conceição Amorim & Vinícius Diniz Mayrink, 2020. "Clustering non-linear interactions in factor analysis," METRON, Springer;Sapienza Università di Roma, vol. 78(3), pages 329-352, December.
    9. Wilson J. Wright & Peter N. Neitlich & Alyssa E. Shiel & Mevin B. Hooten, 2022. "Mechanistic spatial models for heavy metal pollution," Environmetrics, John Wiley & Sons, Ltd., vol. 33(8), December.
    10. James Joseph Balamuta & Steven Andrew Culpepper, 2022. "Exploratory Restricted Latent Class Models with Monotonicity Requirements under PÒLYA–GAMMA Data Augmentation," Psychometrika, Springer;The Psychometric Society, vol. 87(3), pages 903-945, September.
    11. Athanasios C. Micheas & Jiaxun Chen, 2018. "sppmix: Poisson point process modeling using normal mixture models," Computational Statistics, Springer, vol. 33(4), pages 1767-1798, December.
    12. Francis J. DiTraglia, 2011. "Using Invalid Instruments on Purpose: Focused Moment Selection and Averaging for GMM, Second Version," PIER Working Paper Archive 14-045, Penn Institute for Economic Research, Department of Economics, University of Pennsylvania, revised 09 Dec 2014.
    13. Xiaotian Zhu & David R. Hunter, 2019. "Clustering via finite nonparametric ICA mixture models," Advances in Data Analysis and Classification, Springer;German Classification Society - Gesellschaft für Klassifikation (GfKl);Japanese Classification Society (JCS);Classification and Data Analysis Group of the Italian Statistical Society (CLADAG);International Federation of Classification Societies (IFCS), vol. 13(1), pages 65-87, March.
    14. DiTraglia, Francis J., 2016. "Using invalid instruments on purpose: Focused moment selection and averaging for GMM," Journal of Econometrics, Elsevier, vol. 195(2), pages 187-208.
    15. Sbrana, Giacomo & Pelagatti, Matteo, 2024. "Optimal hierarchical EWMA forecasting," International Journal of Forecasting, Elsevier, vol. 40(2), pages 616-625.
    16. Francis DiTraglia, 2011. "Using Invalid Instruments on Purpose: Focused Moment Selection and Averaging for GMM, Second Version," PIER Working Paper Archive 15-027, Penn Institute for Economic Research, Department of Economics, University of Pennsylvania, revised 10 Aug 2015.
    17. Wenbo Wu & Jeremy M. G. Taylor & Andrew F. Brouwer & Lingfeng Luo & Jian Kang & Hui Jiang & Kevin He, 2022. "Scalable proximal methods for cause-specific hazard modeling with time-varying coefficients," Lifetime Data Analysis: An International Journal Devoted to Statistical Methods and Applications for Time-to-Event Data, Springer, vol. 28(2), pages 194-218, April.
    18. Fernández de Marcos Giménez de los Galanes, Alberto, 2022. "Data-driven stabilizations of goodness-of-fit tests," DES - Working Papers. Statistics and Econometrics. WS 35324, Universidad Carlos III de Madrid. Departamento de Estadística.
    19. Cindy Frascolla & Guillaume Lecuelle & Pascal Schlich & Hervé Cardot, 2022. "Two sample tests for Semi-Markov processes with parametric sojourn time distributions: an application in sensory analysis," Computational Statistics, Springer, vol. 37(5), pages 2553-2580, November.
    20. Samrachana Adhikari & Tracy Sweet & Brian Junker, 2021. "Analysis of longitudinal advice‐seeking networks following implementation of high stakes testing," Journal of the Royal Statistical Society Series A, Royal Statistical Society, vol. 184(4), pages 1475-1500, October.

    More about this item

    Statistics

    Access and download statistics

    Corrections

    All material on this site has been provided by the respective publishers and authors. You can help correct errors and omissions. When requesting a correction, please mention this item's handle: RePEc:taf:amstat:v:72:y:2018:i:1:p:28-36. See general information about how to correct material in RePEc.

    If you have authored this item and are not yet registered with RePEc, we encourage you to do it here. This allows to link your profile to this item. It also allows you to accept potential citations to this item that we are uncertain about.

    If CitEc recognized a bibliographic reference but did not link an item in RePEc to it, you can help with this form .

    If you know of missing items citing this one, you can help us creating those links by adding the relevant references in the same way as above, for each refering item. If you are a registered author of this item, you may also want to check the "citations" tab in your RePEc Author Service profile, as there may be some citations waiting for confirmation.

    For technical questions regarding this item, or to correct its authors, title, abstract, bibliographic or download information, contact: Chris Longhurst (email available below). General contact details of provider: http://www.tandfonline.com/UTAS20 .

    Please note that corrections may take a couple of weeks to filter through the various RePEc services.

    IDEAS is a RePEc service. RePEc uses bibliographic data supplied by the respective publishers.