On 14 November 2016 at 14:27, Anon User wrote:
| Hi, I am trying to send a 3 dimensional object from C++ to R as an R array. I
don’t know how to construct an R array in C++ using Rcpp. I am hoping to look
at an example from one of the CRAN packages that use Rcpp. Can anyone
recommend a package that I should look into?
The unit test files are a first stop -- look at both
inst/unitTests/runit.Vector.R
inst/unitTests/cpp/Vector.cpp
This can be as simple as
// [[Rcpp::export]]
IntegerVector integer_dimension_ctor_3(){
return IntegerVector( Dimension( 2, 3, 4) ) ;
}
Dirk
--
http://dirk.eddelbuettel.com | @eddelbuettel | [email protected]
_______________________________________________
Rcpp-devel mailing list
[email protected]
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel