na_fill: Fill NA or specified positions.

Description Usage Arguments Details See Also Examples

View source: R/na_fill.R

Description

Generic function for filling NA values or specified positions.

Usage

1
na_fill(object, fill, ...)

Arguments

object

an object.

fill

a three component list or a vector that is coerced to a list. Shorter objects are recycled. The three components represent the fill value to the left of the data, within the interior of the data and to the right of the data, respectively. The value of any component may be the keyword "extend" to indicate repetition of the leftmost or rightmost non-NA value or linear interpolation in the interior. NULL means that items are dropped rather than filled.

...

further arguments passed to methods.

ix

logical. Should be the same length as the number of time points. Indicates which time points not to fill. This defaults to the non-NA values.

Details

Fill NA or indicated values.

See Also

na_approx

Examples

1
2
3
4
5
z <- zoo(c(NA, 2, NA, 1, 4, 5, 2, NA))
na_fill(z, "extend")
na_fill(z, c("extend", NA))
na_fill(z, -(1:3))
na_fill(z, list(NA, NULL, NA))

decisionpatterns/na.actions documentation built on Aug. 25, 2020, 8:04 p.m.