[Rcpp-devel] is_na, is_infinite etc

Søren Højsgaard sorenh at math.aau.dk
Thu Jan 23 00:07:57 CET 2014


Dear all,

I am struggeling with checking for NA and Inf in a loop over a numeric vector. I have created these two helpers:

//[[Rcpp::export]]
bool isna( double x){
  return NumericVector::is_na(x) ;
}

//[[Rcpp::export]]
bool isinf( double x){
  return NumericVector::is_infinite(x) ;
}

isna works but compiling isinf gives: 

error: 'is_infinite' is not a member of 'Rcpp::NumericVector {aka Rcpp::Vector<14>}'

>From what I can read on the web, is_infinte IS implemented, so I can't spot what is wrong. Any insight?

Cheers
Søren


More information about the Rcpp-devel mailing list