cpp4r: Header-Only 'C++' and 'R' Interface

Provides a header only, 'C++' interface to 'R' with enhancements over 'cpp11'. Enforces copy-on-write semantics consistent with 'R' behavior. Offers native support for ALTREP objects, 'UTF-8' string handling, modern 'C++11' features and idioms, and reduced memory requirements. Allows for vendoring, making it useful for restricted environments. Compared to 'cpp11', it adds support for converting 'C++' maps to 'R' lists, 'Roxygen' documentation directly in 'C++' code, proper handling of matrix attributes, support for nullable external pointers, bidirectional copy of complex number types, flexibility in type conversions, use of nullable pointers, and various performance optimizations.

Package details

AuthorMauricio Vargas Sepulveda [aut, cre] (ORCID: <https://orcid.org/0000-0003-1017-7574>), Posit Software, PBC [aut] (Original cpp11 package)
MaintainerMauricio Vargas Sepulveda <m.vargas.sepulveda@gmail.com>
LicenseApache License (>= 2)
Version0.5.1
URL https://cpp4r.org https://github.com/pachadotdev/cpp4r
Package repositoryView on CRAN
Installation Install the latest version of this package by entering the following in R:
install.packages("cpp4r")

Try the cpp4r package in your browser

Any scripts or data that you put into this service are public.

cpp4r documentation built on April 16, 2026, 9:06 a.m.