fill.blanks: "Fill down the blank"

Description Usage Arguments Details Value

View source: R/clean_functions.R

Description

For a pre-sorted vector, fill each missing value with that of the preceding element.

Usage

1

Arguments

x

A pre-sorted vector that may contain NA values or empty strings.

Details

fill.blanks() is a wrapper around the zoo::na.locf() function in the package zoo. It can handle both missing values from all data types including character vectors where missing values are often encoded as empty strings.

Value

A vector of the same length and type as x, with all NA values or empty strings replaced by the value of the preceding element in the vector.


mdtrinh/vietnamdata documentation built on May 3, 2019, 11:49 p.m.