naLOCFPlusone {ETLUtils} | R Documentation |
Performs NA replacement by last observation carried forward but adds 1 to the last observation carried forward.
naLOCFPlusone(x)
x |
a numeric vector |
a vector where NA's are replaced with the LOCF + 1
require(zoo)
x <- c(2,NA,NA,4,5,2,NA)
naLOCFPlusone(x)