powered by
Extract all the missing values in a vector and turn them into a given value.
NAtoZero(v, value = 0)
Vector.
Value to be given to the missing valus.
Updated vector.
# NOT RUN { set.seed(1977) vec <- sample(c(round(runif(10, 1, 3)), rep(NA, 10))) NAtoZero(vec) # }
Run the code above in your browser using DataLab