Dear Rcpp Users,

I would like to concatenate two NumericVectors. For instance:

...
NumericVector a( some_STL_vector ) ;
NumericVector b( some_STL_vector ) ;

...  // using Rcpp sugar on a and b

a.insert( a.end(), b.begin(), b.end() );

... // using Rcpp sugar on a



This would work fine if a and be were of type std::vector<double>. However,
NumericVector does not seem to have an insert function which supports the
structure above and therefore this isn't working.

Any ideas on how I could concatenate the two vectors using a different
methodology? The reason I would like to use NumericVectors here is because
I am using Rcpp sugar on a and b and the resulting concatenated vector and
I would like to avoid converting them back and forth between std::vector
and NumericVector.

Thanks,

Martin
_______________________________________________
Rcpp-devel mailing list
Rcpp-devel@lists.r-forge.r-project.org
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel

Reply via email to