Replace NAs in parallel vectors
Replaces NA elements of x with corresponding element of y, and NA elements of that with corresponding element from dots.
coalesce(x, y, ...)
x |
a vector |
y |
replacement values |
... |
further replacement values |
x with NAs replaced with y
Rather than using eagerly evaluating the dot arguments and Reducing over them, instead we use recursion to evaluate them lazily.
x <- c(1:4, NA, 1:4, NA) y <- c(1:9, NA) z <- c(NA, NA, 1:8) coalesce(x,y,z)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.