replace_na: Replace NA values with 'replacement'.

Description Usage Arguments Value Examples

View source: R/replace.R

Description

Replace NA values with replacement.

Usage

1
replace_na(vector, replacement, warn = TRUE)

Arguments

vector

Vector to replace NA values in.

replacement

Value to replace NAs with (must be a single element).

warn

Logical indicating whether to issue a warning message if no element is replaced.

Value

Vector with all NA elements replaced by replacement.

Note that factors will be releveled with the replacement values and levels no longer present in the factor may be lost.

Examples

1
replace_na(c("a", "b", NA), "look at me")

seaaan/easieR documentation built on May 29, 2019, 4:23 p.m.