Skip to content
Prev 389047 / 398506 Next

How to globally convert NaN to NA in dataframe?

Yes, even
Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
     NA      NA      NA     NaN      NA      NA       1 

which is presumably because the mean is an empty sum (= 0) divided by a zero count, and 0/0 = NaN.

Notice also the differenc between
[1] NA
[1] NaN