SyntaxFix
Write A Post
Hire A Developer
Questions
The following should do what you want:
x <- data.frame(X1=sample(c(1:3,NaN), 200, replace=TRUE), X2=sample(c(4:6,NaN), 200, replace=TRUE)) head(x) x <- replace(x, is.na(x), 0) head(x)