This reproducible example is a very simplified version of my code:
x <- c(NaN, 2, 3) #This is fine, as expected max(x) > NaN #Why does na.rm remove NaN? max(x, na.rm=TRUE) > 3
For me, NA (missing value) and NaN (rather than a number) are two completely different objects, why does na.rm remove NaN ? How can I ignore NA , not NaN ?
ps: I am using the 64-bit version of R.0.0.0.0 on Windows7.
Edit: In another study, I found that is.na also returns true for NaN ! This is the reason for the confusion for me.
is.na(NaN) > TRUE
r nan na
Nishanth
source share