Re: [R] Using as.integer(NA) in the .C function

2013-05-07 Thread cgenolin
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); } --

Re: [R] Using as.integer(NA) in the .C function

2013-05-07 Thread Berend Hasselman
On 07-05-2013, at 15:30, cgenolin wrote: > Hi the list, > I am including some C code in a R program using the .C interface. I want to > deal with NA values, but the result is strange: > > --- 8< C code --- > void hein(int *a, int *b, int* c){ > *c = (*a + *b); > } > --- 8<

[R] Using as.integer(NA) in the .C function

2013-05-07 Thread cgenolin
Hi the list, I am including some C code in a R program using the .C interface. I want to deal with NA values, but the result is strange: --- 8< C code --- void hein(int *a, int *b, int* c){ *c = (*a + *b); } --- 8< --- --- 8< - R c