How to correctly convert NaN to NA

Viewed 14684

On a given double vector, how come I can define -999 to NA by

v[v == -999] <- NA

but not

v[v == NaN] <- NA

and how do I convert NaN's to NA's correctly?

1 Answers
Related