Hi all,

I'm still just getting my feet wet in Rcpp, so please excuse the
naivety of my question, but is this the appropriate idiom for treating
an input as a C++ scalar?

f <- cxxfunction(signature(x = "integer"), plugin = "Rcpp", '
  Rcpp::IntegerVector x1(x);
  int x2 = x1[0];

  return(Rcpp::NumericVector(x2));
')

i.e. is there any way I can turn x in x2 more succinctly?  (This
function is just for illustrative purposes - I'm trying to do
something at least a little more complicated)

Thanks!

Hadley

-- 
Assistant Professor / Dobelman Family Junior Chair
Department of Statistics / Rice University
http://had.co.nz/
_______________________________________________
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