SyntaxFix
Write A Post
Hire A Developer
Questions
You can also use logical tests
x <- data.frame(a = c(0,1,2,NA), b = c(0,NA,1,2), c = c(NA, 0, 1, 2)) x x$a <- replace(x$a, is.na(x$a), 0) x x$b <- replace(x$b, x$b==2, 333)