Fill data values downstream, like in spreadsheets
Replaces "ditto" values with preceding values
Fill(x, ditto="")
x
: Vector, possibly with missing valuesditto
: What to fill, typically empty string "" (default) or NAVector with replaced values
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)
Useful links