Fill | R Documentation |
Replaces "ditto" values with preceding values
Fill(x, ditto="")
x |
Vector, possibly with missing values |
ditto |
What to fill, typically empty string "" (default) or NA |
Vector 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.