fill_na: Fill Missing values from another vector

View source: R/na_helper.R

fill_naR Documentation

Fill Missing values from another vector

Description

Fill NAs values from x using values from fill that in the same location. Vector x and fill must have the same length.

Usage

fill_na(x, fill)

Arguments

x

Vector to fill NA

fill

A Vector whose elements will be retrieved to fill in x

Value

A Vector with original element from x and filled NA from fill

Examples


v1 <- c(NA, NA, "a", NA, "b") # Trust v1
v2 <- c(NA, "c", "d","k", NA)
fill_na(v1, v2)


Lightbridge-KS/lbx documentation built on Dec. 4, 2024, 2:53 a.m.