Re: [Rcpp-devel] Convertion from SEXP to std::vector

2012-08-22 Thread Douglas Bates
On Wed, Aug 22, 2012 at 9:55 AM, Peng Yu wrote: > Hi, > > Rcpp::IntegerVector can not be converted to std::vector. Is > there a class that can help convert SEXP to std::vector? > > The current walkaround can be something like the following. I'm > wondering if there is a better solution? > > Rcpp::

[Rcpp-devel] Convertion from SEXP to std::vector

2012-08-22 Thread Peng Yu
Hi, Rcpp::IntegerVector can not be converted to std::vector. Is there a class that can help convert SEXP to std::vector? The current walkaround can be something like the following. I'm wondering if there is a better solution? Rcpp::IntegerVector vec(vx); std::vector v; for (int i=0; ihttps://li