powered by
NA
LOCF(x) "LOCF"(x) "LOCF"(x) "LOCF"(x)
d.frm <- data.frame( tag=rep(c("mo", "di", "mi", "do", "fr", "sa", "so"), 4) , val=rep(c(runif(5), rep(NA,2)), 4) ) d.frm$locf <- LOCF( d.frm$val ) d.frm
Run the code above in your browser using DataLab