Fill: Fill data values downstream, like in spreadsheets

View source: R/fill.r

FillR 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

Ditto

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)

shipunov documentation built on Feb. 16, 2023, 9:05 p.m.

Related to Fill in shipunov...