extend: Series Extention

View source: R/extend.R

extendR Documentation

Series Extention

Description

Extend a regular series with missing values at the beginning or end by replacing the beginning missing values with the first non-missing value and replacing the ending missing values with the last non-missing value

Usage

extend(x)

Arguments

x

a numeric vector that represent a regular series. Missing values are permitted and are replaced with non-missing values.

Value

A vector like x with missing value replaced.

Note

Interior missing values should be replaced first with a function like fillMissing.

See Also

fillMissing

Examples

XT <- c(NA, NA, 1.2, 2.4, 3.5, NA)
extend(XT)

USGS-R/DVstats documentation built on Oct. 11, 2022, 6:03 a.m.