powered by
Function by Hong Ooi; https://stackoverflow.com/questions/18142117/how-to-replace-nan-value-with-zero-in-a-huge-data-frame
# S3 method for data.frame is.nan(x)
logical. Returns info if data.frame contains NaNs.
Data frame to be checked for NaN
## this function will overwrite the is.nan function that works only on vectors and matrices df<-data.frame(c(0,NaN), c(1, 2)) is.nan(df) df[is.nan(df)]<- 0
Run the code above in your browser using DataLab