[Rcpp-devel] Translating between Rcpp Vectors and Matrices?

Kevin Ushey kevinushey at gmail.com
Fri Feb 1 02:41:50 CET 2013


Hi guys,

I was wondering - is there a way to translate between Vectors and Matrices?
Eg, reinterpreting a 100 length NumericVector as a 10x10 NumericMatrix by
setting the dimensions explicitly, or something of that form; preferably
with a minimal amount of copying.

Alternatively, is there a preferred method for constructing a
NumericMatrix for output from a std::vector?

The motivation is primarily for reshaping of R objects through Rcpp. I
wasn't able to find anything specific in the vignettes.

-Kevin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20130131/ad842bc8/attachment.html>


More information about the Rcpp-devel mailing list