Fill {shipunov} | R Documentation |
Fill data values downstream, like in spreadsheets
Description
Replaces "ditto" values with preceding values
Usage
Fill(x, ditto="")
Arguments
x |
Vector, possibly with missing values |
ditto |
What to fill, typically empty string "" (default) or NA |
Value
Vector with replaced values
Author(s)
Alexey Shipunov
See Also
Examples
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)
[Package shipunov version 1.17.1 Index]