Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- library(Rcpp)
- sourceCpp(code = '
- // [[Rcpp::plugins(cpp11)]]
- #include <RcppArmadillo.h>
- // [[Rcpp::depends(RcppArmadillo)]]
- using namespace Rcpp;
- // [[Rcpp::export]]
- arma::vec foo(arma::vec a){
- a.transform( [](double val) { return (val + 123.0); } );
- return a;
- }
- ')
- foo(1:3)
Advertisement
Add Comment
Please, Sign In to add comment