Header-Only 'C++' and 'R' Interface
Overview
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++' 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.
- Allows a header only codebase. The previous versions required one or more .cpp files in order to register the exposed functions.
From NEWS.md in the release
Install
Health
- OK13 OK2026-08-05
- NOTE12 OK, 1 NOTE2026-08-01
- OK14 OK2026-03-10
Documentation
- Help pages
- 5includes a package overview page
- Examples that run
- 100%4 run in a plain check
- Exported functions with examples
- 100%
- Documented parameters
- 100%
- Return-value docs
- 100%
- Help pages citing references
- 0%
Downloads
Repository
- PRs merged (all time)
- 100%
- Median days to close, 50 most recently updated closed issues
- 19
- Median days to close, 50 most recently updated closed PRs
- 0
Stars over time
Issues over time
PRs over time
Commits over time
11 development-tooling and community-health practices detected across 6 families in the upstream repository
Checks run against github.com/pachadotdev/cpp4r on 2026-10-21.
The R CMD check workflow runs on Linux, macOS and Windows, and on R-devel
The repository owner accepts GitHub Sponsors
GitHub Pages site last deployed 2026-09-23
Show all practicesHide 2 practices
Dependencies
Installing cpp4r adds no packages beyond those that come with R.
Code & Tests
People & History
Package metadata
- First published
- 2025-10-16
- Total releases
- 8 / 1 yrs
- License
- Apache License (>= 2)
- Minimum R
- ≥ 4.0.0
- Download size
- 203 KB
Cite
Cite this package
Run in R for the authors' preferred citation:
citation("cpp4r")This package has no citation file, so citation() returns this entry built from DESCRIPTION.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-25, which the citation names so these numbers can be found later. More on citing and the projects behind them.