Replaces "ditto" values with preceding values
Fill(x, ditto="")
Vector, possibly with missing values
What to fill, typically empty string "" (default) or NA
Vector with replaced values
# NOT RUN {
aa <- c("a", "a", "", "b", "", "c", "d", "")
Fill(aa)
bb <- c("a", "a", NA, "b", NA, "c", "d", NA)
Fill(bb, ditto=NA)
dd <- c("", "a", "a", "", "", "b", NA, "", "c", "d", "")
Fill(dd)
# }
Run the code above in your browser using DataLab