- All C++ code is in
src
- Code that uses only basic
Rcpp
is insrc/examples.cpp
- Code that uses
RcppArmadillo
is insrc/examples_arma.cpp
- Code that uses
RcppEigen
is insrc/examples_eigen.cpp
Installation:
devtools::install_github('jtimonen/RcppExample')
Example use:
library(RcppExample)
hello_world() # prints message to standard output stream
# Returns an array with dim(A) equal to c(2,2,3)
A <- arma_3_matrices(c(1,2))
# Returns a list with length 2, so that
# - B[[1]] is a 2x2 matrix
# - B[[2]] is a 3x2 matrix
B <- eigen_2_matrices()