powered by
vec
Assumes first element is non-NA
naReplace(vec)
numeric
vector with each NA entry replaced with the last previous non-NA entry.
vector
NA
Vector of any type
Pål Christie Ryalen <p.c.ryalen@medisin.uio.no>
naReplace(c(1, 2, 3, NA, NA, 4)) naReplace(c("text", NA, NA))
Run the code above in your browser using DataLab