patch_vector: Patch a current vector from a target vector.

Description Usage Arguments Value Examples

View source: R/helpers.R

Description

Patch a current vector from a target vector.

Usage

1
patch_vector(current, target, only_na = FALSE)

Arguments

current

A vector to be patched.

target

A patch vector. If length 1 then recycled to the length of current and only NA are patched.

only_na

If TRUE then only missing values in current are patched.

Value

A patched vector.

Examples

1
2
3
patchr::patch_vector(c(1, NA_real_, 3), c(4, 5, 6))
patchr::patch_vector(c(1, NA_real_, 3), c(4, 5, 6), only_na = TRUE)
patchr::patch_vector(c(1, NA_real_, 3), 4)

stephLH/patchr documentation built on May 14, 2020, 5:57 a.m.