Damm... I am reading the WRE, but I am only at page 83. I start to try to play with NAOK to early.
Anyway, exactly the same function for numeric instead of integer will give different results: --- 8< ------------ C code ----------- void hein2(double *a, double *b, double* c){ *c = (*a + *b); } --- 8< ----------------------------------- --- 8< ------------- R code ----------- .C("hein2",as.numeric(NA),as.numeric(1),as.numeric(1),NAOK=TRUE)[[3]] [1] NA --- 8< --------------------------------- That's why I find the results of "hein" stranges... Christophe -- View this message in context: http://r.789695.n4.nabble.com/Using-as-integer-NA-in-the-C-function-tp4666470p4666476.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.