All Projects → RcppCore → Rcpparmadillo

RcppCore / Rcpparmadillo

Rcpp integration for Armadillo templated linear algebra library

Programming Languages

r
7636 projects

Labels

Projects that are alternatives of or similar to Rcpparmadillo

Pkgverse
📦🔭🌠 Create your own universe of packages à la tidyverse
Stars: ✭ 108 (-15.62%)
Mutual labels:  r-package
Jtools
Tools for summarizing/visualizing regressions and other helpful stuff
Stars: ✭ 115 (-10.16%)
Mutual labels:  r-package
Osmplotr
Data visualisation using OpenStreetMap objects
Stars: ✭ 122 (-4.69%)
Mutual labels:  r-package
Starters
R Package 📦 for initializing projects for various R activities 🔩
Stars: ✭ 111 (-13.28%)
Mutual labels:  r-package
Mlr
Machine Learning in R
Stars: ✭ 1,542 (+1104.69%)
Mutual labels:  r-package
Available
Check if a package name is available to use
Stars: ✭ 116 (-9.37%)
Mutual labels:  r-package
Clustermq
R package to send function calls as jobs on LSF, SGE, Slurm, PBS/Torque, or each via SSH
Stars: ✭ 106 (-17.19%)
Mutual labels:  r-package
Datapackager
An R package to enable reproducible data processing, packaging and sharing.
Stars: ✭ 125 (-2.34%)
Mutual labels:  r-package
Umapr
UMAP dimensionality reduction in R
Stars: ✭ 115 (-10.16%)
Mutual labels:  r-package
Piggyback
📦 for using large(r) data files on GitHub
Stars: ✭ 122 (-4.69%)
Mutual labels:  r-package
Ssh
Native SSH client in R based on libssh
Stars: ✭ 111 (-13.28%)
Mutual labels:  r-package
Rgbif
Interface to the Global Biodiversity Information Facility API
Stars: ✭ 113 (-11.72%)
Mutual labels:  r-package
Roomba
General purpose API response tidier
Stars: ✭ 117 (-8.59%)
Mutual labels:  r-package
Pkgnet
R package for analyzing other R packages via graph representations of their dependencies
Stars: ✭ 107 (-16.41%)
Mutual labels:  r-package
Jqr
R interface to jq
Stars: ✭ 123 (-3.91%)
Mutual labels:  r-package
Loo
loo R package for approximate leave-one-out cross-validation (LOO-CV) and Pareto smoothed importance sampling (PSIS)
Stars: ✭ 106 (-17.19%)
Mutual labels:  r-package
Gramr
RStudio Addin, function, & shiny app for the write-good linter 📝
Stars: ✭ 116 (-9.37%)
Mutual labels:  r-package
Drat
Drat R Archive Template
Stars: ✭ 127 (-0.78%)
Mutual labels:  r-package
Minicran
R package to create internally consistent, mini version of CRAN
Stars: ✭ 123 (-3.91%)
Mutual labels:  r-package
Modistsp
An "R" package for automatic download and preprocessing of MODIS Land Products Time Series
Stars: ✭ 118 (-7.81%)
Mutual labels:  r-package

RcppArmadillo: R and Armadillo via Rcpp

Build Status CI License CRAN Dependencies Debian package Last Commit
Downloads CRAN use CRAN indirect BioConductor use StackOverflow CSDA

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:

#include <RcppArmadillo.h>
// [[Rcpp::depends(RcppArmadillo)]]

// [[Rcpp::export]]
Rcpp::List fastLm(const arma::mat& X, const arma::colvec& y) {
    int n = X.n_rows, k = X.n_cols;

    arma::colvec coef = arma::solve(X, y);    // fit model y ~ X
    arma::colvec res  = y - X*coef;           // residuals

    // std.errors of coefficients
    double s2 = std::inner_product(res.begin(), res.end(), res.begin(), 0.0)/(n - k);

    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 slightly more involved version is also included in the package as the fastLm() function.

Status

The package is 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. As of September 2019, there are 658 CRAN packages using RcppArmadillo.

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

install.packages("RcppArmadillo")

to install from your nearest CRAN mirror.

Authors

Dirk Eddelbuettel, Romain Francois, Doug Bates and Binxiang Ni

License

GPL (>= 2)

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].