What\'s a compact/efficient way to populate NAs using the prior non-NA value? For example:
test = c( 1 , 2 , NA , NA , 5 , NA , 9 , NA , NA ) expected = c(
library(zoo) na.locf(test) [1] 1 2 2 2 5 5 9 9 9