replace_na {mltools} | R Documentation |
Convenience method for returning a copy of a vector such that NA values are substituted with a replacement value
replace_na(x, repl = "auto")
x |
vector of values |
repl |
what to substitute in place of NAs |
Returns a copy of x
such that NAs get replaced with a replacement value. Default replacement value is 0.
replace_na(c(1, NA, 1, 0))