{"id":17108844,"url":"https://github.com/rcppcore/rcpparmadillo","last_synced_at":"2025-05-14T15:05:56.806Z","repository":{"id":11582494,"uuid":"14072238","full_name":"RcppCore/RcppArmadillo","owner":"RcppCore","description":"Rcpp integration for the Armadillo templated linear algebra library","archived":false,"fork":false,"pushed_at":"2025-04-26T11:51:51.000Z","size":11369,"stargazers_count":202,"open_issues_count":6,"forks_count":56,"subscribers_count":19,"default_branch":"master","last_synced_at":"2025-05-13T22:51:36.826Z","etag":null,"topics":["armadillo","c-plus-plus","r","r-package","rcpp","rcpparmadillo"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RcppCore.png","metadata":{"files":{"readme":"README.md","changelog":"ChangeLog","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2013-11-02T18:33:00.000Z","updated_at":"2025-04-26T11:51:55.000Z","dependencies_parsed_at":"2024-04-10T15:27:03.129Z","dependency_job_id":"341cf848-a668-4e4e-ab57-9235293b173a","html_url":"https://github.com/RcppCore/RcppArmadillo","commit_stats":{"total_commits":1357,"total_committers":20,"mean_commits":67.85,"dds":"0.16654384672070743","last_synced_commit":"12268f2ea4d152e1188a4affbabb99e4e4689c8f"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RcppCore%2FRcppArmadillo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RcppCore%2FRcppArmadillo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RcppCore%2FRcppArmadillo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RcppCore%2FRcppArmadillo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RcppCore","download_url":"https://codeload.github.com/RcppCore/RcppArmadillo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254169149,"owners_count":22026208,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["armadillo","c-plus-plus","r","r-package","rcpp","rcpparmadillo"],"created_at":"2024-10-14T16:06:23.021Z","updated_at":"2025-05-14T15:05:56.767Z","avatar_url":"https://github.com/RcppCore.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n## RcppArmadillo: R and Armadillo via Rcpp\n\n[![CI](https://github.com/RcppCore/RcppArmadillo/workflows/ci/badge.svg)](https://github.com/RcppCore/RcppArmadillo/actions?query=workflow%3Aci)\n[![License](https://eddelbuettel.github.io/badges/GPL2+.svg)](https://www.gnu.org/licenses/gpl-2.0.html)\n[![CRAN](https://www.r-pkg.org/badges/version/RcppArmadillo)](https://cran.r-project.org/package=RcppArmadillo)\n[![Debian package](https://img.shields.io/debian/v/r-cran-rcpparmadillo/sid?color=brightgreen)](https://packages.debian.org/sid/r-cran-rcpparmadillo)\n[![r-universe](https://rcppcore.r-universe.dev/badges/RcppArmadillo)](https://rcppcore.r-universe.dev/RcppArmadillo)\n[![Dependencies](https://tinyverse.netlify.app/badge/RcppArmadillo)](https://cran.r-project.org/package=RcppArmadillo)\n[![Coverage Status](https://codecov.io/gh/RcppCore/RcppArmadillo/graph/badge.svg)](https://app.codecov.io/github/RcppCore/RcppArmadillo?branch=master)\n[![Last Commit](https://img.shields.io/github/last-commit/RcppCore/RcppArmadillo)](https://github.com/RcppCore/RcppArmadillo)\n[![Downloads (monthly)](https://cranlogs.r-pkg.org/badges/RcppArmadillo?color=brightgreen)](https://www.r-pkg.org/pkg/RcppArmadillo)\n[![Downloads (total)](https://cranlogs.r-pkg.org/badges/grand-total/RcppArmadillo?color=brightgreen)](https://www.r-pkg.org/pkg/RcppArmadillo)\n[![CRAN use](https://jangorecki.gitlab.io/rdeps/RcppArmadillo/CRAN_usage.svg?sanitize=true)](https://cran.r-project.org/package=RcppArmadillo)\n[![CRAN indirect](https://jangorecki.gitlab.io/rdeps/RcppArmadillo/indirect_usage.svg?sanitize=true)](https://cran.r-project.org/package=RcppArmadillo)\n[![BioConductor use](https://jangorecki.gitlab.io/rdeps/RcppArmadillo/BioC_usage.svg?sanitize=true)](https://cran.r-project.org/package=RcppArmadillo)\n[![CSDA](https://img.shields.io/badge/CSDA-10.1016%2Fj.csda.2013.02.005-brightgreen)](https://doi.org/10.1016/j.csda.2013.02.005)\n\n### Synopsis\n\nRcppArmadillo provides an interface from R to and from [Armadillo][armadillo] by utilising the [Rcpp\nR/C++ interface library][rcpp].\n\n### What is Armadillo?\n\n[Armadillo][armadillo] is a high-quality linear algebra library for the C++ language, aiming towards\na good balance between speed and ease of use. It provides high-level syntax and\n[functionality](https://arma.sourceforge.net/docs.html) deliberately similar to Matlab (TM).  See\n[its website][armadillo] more information about Armadillo.\n\n### So give me an example!\n\nGlad you asked. Here is a light-weight and fast implementation of linear regression:\n\n```c++\n#include \u003cRcppArmadillo/Lighter\u003e\n// [[Rcpp::depends(RcppArmadillo)]]\n\n// [[Rcpp::export]]\nRcpp::List fastLm(const arma::mat\u0026 X, const arma::colvec\u0026 y) {\n    int n = X.n_rows, k = X.n_cols;\n\n    arma::colvec coef = arma::solve(X, y);     // fit model y ~ X\n    arma::colvec res  = y - X*coef;            // residuals\n    double s2 = arma::dot(res, res) / (n - k); // std.errors of coefficients\n    arma::colvec std_err = arma::sqrt(s2 * arma::diagvec(arma::pinv(arma::trans(X)*X)));\n\n    return Rcpp::List::create(Rcpp::Named(\"coefficients\") = coef,\n                              Rcpp::Named(\"stderr\")       = std_err,\n                              Rcpp::Named(\"df.residual\")  = n - k);\n}\n```\n\nYou can\n[`Rcpp::sourceCpp()`](https://cran.r-project.org/package=Rcpp/vignettes/Rcpp-attributes.pdf)\nthe file above to compile the function.  A version is also included in the\npackage [as the `fastLm()`](https://github.com/RcppCore/RcppArmadillo/blob/master/R/fastLm.R)\nfunction.\n\nThe `RcppArmadillo/Lighter` header includes [Rcpp][rcpp] via its `Rcpp/Lighter` header which\nprecludes some more compile-time heavy features such as 'Rcpp Modules' which we may not need. See\nthe [Rcpp][rcpp] docs more details about 'Light', 'Lighter' and 'Lightest'.  In the example above,\nthe switch saves about 15% of total compilation time.\n\n### Status\n\nThe package is mature yet under active development with releases to [CRAN][cran] about once every\nother month, and widely-used by other CRAN packages as can be seen from the [CRAN package page][cran\npkg].  As of April 2024, there are 1135 CRAN packages using RcppArmadillo.\n\n### Documentation\n\nThe package contains a pdf vignette which is a pre-print of the\n[paper by Eddelbuettel and Sanderson](http://dx.doi.org/10.1016/j.csda.2013.02.005)\nin CSDA (2014), as well as an introductory vignette for the sparse\nmatrix conversions.\n\n### Installation\n\nRcppArmadillo is a [CRAN package][cran pkg], and lives otherwise in its own habitat on\n[GitHub](https://github.com/RcppCore/RcppArmadillo) within the\n[RcppCore](https://github.com/RcppCore) GitHub organization.\n\nRun\n\n```r\ninstall.packages(\"RcppArmadillo\")\n```\n\nto install from your nearest CRAN mirror.\n\n### Authors\n\nDirk Eddelbuettel, Romain Francois, Doug Bates, Binxiang Ni, and Conrad Sanderson\n\n### License\n\nGPL (\u003e= 2)\n\n\n[armadillo]: https://arma.sourceforge.net\n[rcpp]: https://www.rcpp.org\n[cran]: https://cran.r-project.org\n[cran pkg]: https://cran.r-project.org/package=RcppArmadillo\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frcppcore%2Frcpparmadillo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frcppcore%2Frcpparmadillo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frcppcore%2Frcpparmadillo/lists"}