RcppArmadillo
Rcpp integration for the Armadillo templated linear algebra library
Science Score: 49.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
✓DOI references
Found 5 DOI reference(s) in README -
○Academic publication links
-
✓Committers with academic emails
3 of 20 committers (15.0%) from academic institutions -
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (11.2%) to scientific vocabulary
Keywords
Keywords from Contributors
Repository
Rcpp integration for the Armadillo templated linear algebra library
Basic Info
Statistics
- Stars: 203
- Watchers: 18
- Forks: 56
- Open Issues: 11
- Releases: 0
Topics
Metadata Files
README.md
RcppArmadillo: R and Armadillo via Rcpp
Synopsis
RcppArmadillo provides an interface from R to and from Armadillo by utilising the Rcpp R/C++ interface library.
What is Armadillo?
Armadillo is a high-quality linear algebra library for the C++ language, aiming towards a good balance between speed and ease of use. It provides high-level syntax and functionality deliberately similar to Matlab (TM). See its website more information about Armadillo.
So give me an example!
Glad you asked. Here is a light-weight and fast implementation of linear regression:
```c++
include
// [[Rcpp::depends(RcppArmadillo)]]
// [[Rcpp::export]] Rcpp::List fastLm(const arma::mat& X, const arma::colvec& y) { int n = X.nrows, k = X.ncols;
arma::colvec coef = arma::solve(X, y); // fit model y ~ X
arma::colvec res = y - X*coef; // residuals
double s2 = arma::dot(res, res) / (n - k); // std.errors of coefficients
arma::colvec std_err = arma::sqrt(s2 * arma::diagvec(arma::pinv(arma::trans(X)*X)));
return Rcpp::List::create(Rcpp::Named("coefficients") = coef,
Rcpp::Named("stderr") = std_err,
Rcpp::Named("df.residual") = n - k);
} ```
You can
Rcpp::sourceCpp()
the file above to compile the function. A version is also included in the
package as the fastLm()
function.
The RcppArmadillo/Lighter header includes Rcpp via its Rcpp/Lighter header which
precludes some more compile-time heavy features such as 'Rcpp Modules' which we may not need. See
the Rcpp docs more details about 'Light', 'Lighter' and 'Lightest'. In the example above,
the switch saves about 15% of total compilation time.
Status
The package is mature yet under active development with releases to CRAN about once every other month, and widely-used by other CRAN packages as can be seen from the [CRAN package page]cran pkg. As of August 2025, there are 1266 CRAN packages using RcppArmadillo.
As of Armadillo 15.0.0, the minimum compilation standard is C++14. However, as several hundred CRAN packages still impose C++11 as their compilation standard, the RcppArmadillo package also includes the final version allowing C++11, namely Armadillo 14.6.3, as a fallback used when C++11 compilation is detected. Conversion to and compilation under C++14 or later is encouraged. R defaults to C++17 since version 4.3.0. See GitHub issue #475 for more about choosing between 'legacy' Armadillo 14.6.3 or 'current' Armadillo 15.0.1 or later.
Documentation
The package contains a pdf vignette which is a pre-print of the paper by Eddelbuettel and Sanderson in CSDA (2014), as well as an introductory vignette for the sparse matrix conversions.
Installation
RcppArmadillo is a CRAN package, and lives otherwise in its own habitat on GitHub within the RcppCore GitHub organization.
Run
r
install.packages("RcppArmadillo")
to install from your nearest CRAN mirror.
Authors
Dirk Eddelbuettel, Romain Francois, Doug Bates, Binxiang Ni, and Conrad Sanderson
License
GPL (>= 2)
Owner
- Name: Rcpp
- Login: RcppCore
- Kind: organization
- Website: http://www.rcpp.org
- Repositories: 10
- Profile: https://github.com/RcppCore
GitHub Events
Total
- Issues event: 21
- Watch event: 12
- Delete event: 8
- Issue comment event: 50
- Push event: 53
- Pull request review comment event: 4
- Pull request review event: 6
- Pull request event: 12
- Fork event: 1
- Create event: 8
Last Year
- Issues event: 21
- Watch event: 12
- Delete event: 8
- Issue comment event: 50
- Push event: 53
- Pull request review comment event: 4
- Pull request review event: 6
- Pull request event: 12
- Fork event: 1
- Create event: 8
Committers
Last synced: 8 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| Dirk Eddelbuettel | e****d@d****g | 1,160 |
| Romain François | r****n@r****m | 143 |
| Douglas Bates | d****s@g****m | 16 |
| Binxiang Ni | b****i@g****m | 13 |
| Kevin Ushey | k****y@g****m | 9 |
| Keith O'Hara | k****a@n****u | 8 |
| Conrad Sanderson | c****a | 8 |
| James Balamuta | b****2@i****u | 4 |
| xian@oryza | i****a@g****m | 4 |
| Jonathan Berrisch | j****n@b****z | 4 |
| George G. Vega Yon | g****n@g****m | 3 |
| nathan-russell | r****2@g****m | 3 |
| Serguei Sokol | s****r | 2 |
| Serguei Sokol | s****l@i****r | 2 |
| Tomasz Kalinowski | k****t@g****m | 2 |
| Mikael Jagan | j****n@m****a | 1 |
| Min Kim | m****k@d****t | 1 |
| Qiang Kou (KK) | q****u@q****o | 1 |
| Martin Pacala | m****a@w****t | 1 |
| Santiago Olivella | s****a@g****m | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 88
- Total pull requests: 95
- Average time to close issues: about 1 month
- Average time to close pull requests: 1 day
- Total issue authors: 59
- Total pull request authors: 9
- Average comments per issue: 7.41
- Average comments per pull request: 1.41
- Merged pull requests: 84
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 15
- Pull requests: 15
- Average time to close issues: 4 days
- Average time to close pull requests: 3 days
- Issue authors: 8
- Pull request authors: 1
- Average comments per issue: 2.47
- Average comments per pull request: 0.4
- Merged pull requests: 14
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- eddelbuettel (20)
- conradsnicta (3)
- privefl (3)
- coatless (3)
- mattfidler (3)
- pati-ni (2)
- YinLiLin (2)
- UseRSteph (1)
- henrique-anatole (1)
- dselivanov (1)
- jaganmn (1)
- MOOnLyer (1)
- dwachsmuth (1)
- raymondben (1)
- GabrielHoffman (1)
Pull Request Authors
- eddelbuettel (78)
- conradsnicta (9)
- t-kalinowski (2)
- BerriJ (1)
- helske (1)
- jaganmn (1)
- yfyang86 (1)
- jsilve24 (1)
- kevinushey (1)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 2
-
Total downloads:
- cran 368,143 last-month
- Total docker downloads: 35,765,074
-
Total dependent packages: 216
(may contain duplicates) -
Total dependent repositories: 373
(may contain duplicates) - Total versions: 218
- Total maintainers: 1
cran.r-project.org: RcppArmadillo
'Rcpp' Integration for the 'Armadillo' Templated Linear Algebra Library
- Homepage: https://github.com/RcppCore/RcppArmadillo
- Documentation: http://cran.r-project.org/web/packages/RcppArmadillo/RcppArmadillo.pdf
- License: GPL-2 | GPL-3 [expanded from: GPL (≥ 2)]
-
Latest release: 0.3.820
published almost 13 years ago
Rankings
Maintainers (1)
conda-forge.org: r-rcpparmadillo
- Homepage: https://dirk.eddelbuettel.com/code/rcpp.armadillo.html
- License: GPL-2.0-or-later
-
Latest release: 0.11.4.2.1
published over 3 years ago
Rankings
Dependencies
- R >= 3.3.0 depends
- Rcpp >= 0.11.0 imports
- methods * imports
- stats * imports
- utils * imports
- Matrix >= 1.3.0 suggests
- pkgKitten * suggests
- reticulate * suggests
- slam * suggests
- tinytest * suggests
- actions/checkout v3 composite