mat_apply returns a matrix. row_apply and col_apply return a vector.
See section "Apply" of the package vignette for details.
Arguments
X
A matrix
f
The function to apply.
Details
The mat_apply, row_apply, and col_apply C++ functions are intended to
operate like the following calls in R, respectively.
apply(x, c(1,2), f)
apply(x, 1, f)
apply(x, 2, f)
The R functions exposed here are specific to numeric-valued matrices, but
the underlying C++ functions are intended to work with any type of Rcpp
Matrix.