Hi,<div><br></div><div>I am not sure what I am missing. Any help would be greatly appreciated. I have the following code:</div><div><br></div><div>// myList will have column called "a"</div><div>Rcpp::List myList = someInputList;</div>
<div>Rcpp::NumericVector test = Rcpp::as<Rcpp::NumericVector>(myList["a"]);</div><div><br></div><div>/* up to the above line, everything compiles. </div><div>Now I want to get a double out from first element of test.*/</div>
<div><br></div><div>double test0 = Rcpp::as<double>(test[0]);</div><div><br></div><div>It is the above line that the compiler complains about. I have include Rcpp.h and also my -I path includes Rcpp/include directory. I am not sure why I am getting an error here? Or I have to make a copy of SEXP object representing test[0] before passing it into Rcpp::as<double>? Thank you.</div>
<div><br></div><div>Best regards,</div><div><br></div><div>Robert</div><div><br></div><div><br></div>