mlpack has supported header-onlycompilation since the 4.0.0 release. It also containsan R package thathas been part ofCRAN foryears. Its focus is on access from R at the R prompt: underlyingmlpack functions are properlywrapped.
Sometimes, however, we would like to access the C++ API ofmlpack from the C++ side of an R package.This package provides a working demonstration of how to do this.
Currently, the package contains two examples covering
The package is on CRAN and can be installed via the usual
>install.packages("rcppmlpackexamples")Ther-univerepage has source and binary builds from the repository version whichmay differ from the CRAN version and shows how to install them. Lastly,one can always rely onremotes::install_github():
> remotes::install_github("eddelbuettel/rcppmlpack-examples")We use thercpp prefix to not conflate this repo withthe existingmlpackexamples repo.
Dirk Eddelbuettel for this R package
The mlpack authors for all of mlpack
GPL (>= 2) for this package
MIT for mlpack
Initially created: Sun Sep 21 11:40:39 AM CDT 2025
Last modified: Sun Sep 21 11:43:23 CDT 2025