Learn R Programming

ETLUtils (version 1.6)

naLOCFPlusone: Performs NA replacement by last observation carried forward but adds 1 to the last observation carried forward.

Description

Performs NA replacement by last observation carried forward but adds 1 to the last observation carried forward.

Usage

naLOCFPlusone(x)

Value

a vector where NA's are replaced with the LOCF + 1

Arguments

x

a numeric vector

See Also

Examples

Run this code
require(zoo)
x <- c(2,NA,NA,4,5,2,NA)
naLOCFPlusone(x)

Run the code above in your browser using DataLab