I have a R list something like this -

op=list(a=200, b="test", c=4.5)
when I pass it as an argument to Rcp Export function which the code looks
like this in below.

----------------------------------------
int n = xlist.length();
for (int I=0; I < n; I++) {
  SEXP s = xlist[I];
  if (Rf_isInteger(s)) {
  //do something
  }
  else if (Rf_isNumerc(s)) {
  //do other thing
  }
  else if (Rf_isString(s)) {
  //do other thing
  }
}

However, both a and c go to the Rf_isNumeric if statement; but the first
one is an integer, not sure why it did not go to into the Rf_isInteger if
statement.

Thanks.
_______________________________________________
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