last_not_na: Replaces NA in a vector with the previous most non NA value

View source: R/last_not_na.R

last_not_naR Documentation

Replaces NA in a vector with the previous most non NA value

Description

Replaces NA in a vector with the previous most non NA value. If no preceding non NA values then keep as NA.

Usage

last_not_na(x)

Arguments

x

vector

Value

vector with NAs replaced with preceding value

Examples

last_not_na(c(NA,1, NA, 1:3, NA))


uclalawcovid19behindbars/behindbarstools documentation built on April 22, 2022, 4:08 a.m.