powered by
Replaces "ditto" values with preceding values
Fill(x, ditto="")
Vector with replaced values
Vector, possibly with missing values
What to fill, typically empty string "" (default) or NA
Alexey Shipunov
Ditto
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