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.
README
# How to use cpp11armadillo?
## Read the documentation
The [package website](https://cpp4r.org) covers the basics, customization, and
advanced usage of the package.
## Test the package
1. Open `./dev/01_load_or_install.R` and run it.
2. Open `./src/01_ols.cpp`, inspect the OLS functions.
3. Create your own functions in `./02_your_functions.cpp`.
4. Run `devtools::load_all()` before testing your functions, and then add tests
to `./dev/02_test.R` and run it.
5. Run `./dev/03_readme_and_license.R` to add a README and license.
6. Run `devtools::install()` in `./dev/01_load_or_install.R` to install the
package locally when you are ready.
7. The package template includes a configuration with a predefined number of
cores to use. You can change this value by doing this:
Unix: Edit `./src/Makevars.in` to set `DARMA_OPENMP_THREADS` to another
value or edit `./configure` to change `PKG_NCORES` to another value.
Windows: Edit `./src/Makevars.win` to set `DARMA_OPENMP_THREADS` to another
value.
Versions across snapshots
| Version | Repository | File | Size |
|---|---|---|---|
0.4.0 |
2026-04-09 windows/windows R-4.5 | cpp4r_0.4.0.zip |
103.8 KiB |