Last Observation Carried Forward In a data frame? [duplicate]

This already exists:

library(zoo)
na.locf(data.frame(rep("a",4), 1:4,1:4, c(1,NA,NA,NA)))

Leave a Comment