| Title: | An 'Armadillo' Interface |
|---|---|
| Description: | Provides function declarations and inline function definitions that facilitate communication between R and the 'Armadillo' 'C++' library for linear algebra and scientific computing. This implementation is derived from Vargas Sepulveda and Schneider Malamud (2024) <doi:10.1016/j.softx.2025.102087>. |
| Authors: | Mauricio Vargas Sepulveda [aut, cre] (ORCID: <https://orcid.org/0000-0003-1017-7574>), Jonathan Schneider Malamud [ctb], Conrad Sanderson [aut] (Armadillo library (C++)) |
| Maintainer: | Mauricio Vargas Sepulveda <[email protected]> |
| License: | Apache License (>= 2) |
| Version: | 0.9.0 |
| Built: | 2026-06-04 21:53:14 UTC |
| Source: | https://github.com/pachadotdev/armadillo4r |
Provides the Armadillo C++ library version name and number included in the package.
armadillo_version()armadillo_version()
A string with the Armadillo version name and number
armadillo_version()armadillo_version()
Start a new project with the armadillo4r package template
pkg_template(path = NULL, pkgname = NULL)pkg_template(path = NULL, pkgname = NULL)
path |
Path to the new project |
pkgname |
Name of the new package |
The file path to the copied template (invisibly).
# create a new directory dir <- tempdir() dir.create(dir) # copy the package template into the directory pkg_template(dir, "mynewpkg")# create a new directory dir <- tempdir() dir.create(dir) # copy the package template into the directory pkg_template(dir, "mynewpkg")
This function removes the vendored armadillo4r headers from your package by automatically finding the vendored headers.
unvendor(path = NULL)unvendor(path = NULL)
path |
The directory with the vendored headers. It is recommended to use '"./src/vendor"'. The default is 'NULL'. |
The path to the unvendored code (invisibly).
# create a new directory dir <- paste0(tempdir(), "/", gsub("\\s+|[[:punct:]]", "", Sys.time())) dir.create(dir, recursive = TRUE) # vendor the armadillo4r headers into the directory vendor(dir) # unvendor the armadillo4r headers from the directory unvendor(dir) # cleanup unlink(dir, recursive = TRUE)# create a new directory dir <- paste0(tempdir(), "/", gsub("\\s+|[[:punct:]]", "", Sys.time())) dir.create(dir, recursive = TRUE) # vendor the armadillo4r headers into the directory vendor(dir) # unvendor the armadillo4r headers from the directory unvendor(dir) # cleanup unlink(dir, recursive = TRUE)
Vendoring is the act of making your own copy of the 3rd party packages your project is using. It is often used in the go language community.
This function vendors armadillo4r into your package by copying the armadillo4r headers into the 'inst/include' folder of your package and adding 'armadillo4r version: XYZ' to the top of the files, where XYZ is the version of armadillo4r currently installed on your machine.
**Note**: vendoring places the responsibility of updating the code on **you**. Bugfixes and new features in armadillo4r will not be available for your code until you run 'cpp_vendor()' again.
vendor(path = NULL)vendor(path = NULL)
path |
The directory with the vendored headers. It is recommended to use '"./src/vendor"'. The default is 'NULL'. |
The path to the vendored code (invisibly).
# create a new directory dir <- paste0(tempdir(), "/", gsub("\\s+|[[:punct:]]", "", Sys.time())) dir.create(dir, recursive = TRUE) # vendor the armadillo4r headers into the directory vendor(dir) # just a preview as Armadillo has over 100 files head(list.files(dir, recursive = TRUE)) # cleanup unlink(dir, recursive = TRUE)# create a new directory dir <- paste0(tempdir(), "/", gsub("\\s+|[[:punct:]]", "", Sys.time())) dir.create(dir, recursive = TRUE) # vendor the armadillo4r headers into the directory vendor(dir) # just a preview as Armadillo has over 100 files head(list.files(dir, recursive = TRUE)) # cleanup unlink(dir, recursive = TRUE)