0

How do you convet an RMatrix::Column to a NumericVector in RcppParallel?

e.g.

// [[Rcpp::depends(RcppParallel)]]
// [[Rcpp::plugins("cpp11")]]
#include <Rcpp.h>
#include <RcppParallel.h>

a = RMatrix<double>(4,5,1.0);
RMatrix<double>::Column a0 = a.column(0);
NumericVector b(Rcpp::as<NumericVector>(a0));

error: no matching function for call to 'as' NumericVector b(Rcpp::as(a0));

cmo
  • 3,762
  • 4
  • 36
  • 64
  • 2
    This is the second poorly researched question by you in three hours. I put some time into your previous question; I may be less inclined to so again. Please *do* read the RcppParallel examples more carefully as they show you how this works. – Dirk Eddelbuettel Apr 22 '19 at 18:57
  • 2
    You'll want to read through the `RcppParallel` website, especially this section: http://rcppcore.github.io/RcppParallel/#safe_accessors As an aside, why do you want this conversion (i.e. what purpose would converting an `RcppParallel::RMatrix::Column` to an `Rcpp::NumericVector` accomplish for you)? – duckmayr Apr 23 '19 at 11:02

0 Answers0