Fill NA values with the previous (or following) value.
Usage
na_fill(v, forward = TRUE)
Arguments
- v
A vector.
- forward
If TRUE
, fill starting from first to last element,
If FALSE
, fill in from last to first element.
Value
The vector v
, with NA values filled.