explicit_na: Missing data

View source: R/missing_data.R

explicit_naR Documentation

Missing data

Description

[Stable]

Substitute missing data with a string or factor level.

Usage

explicit_na(x, label = "<Missing>")

Arguments

x

(factor or character)
values for which any missing values should be substituted.

label

(string)
string that missing data should be replaced with.

Value

x with any NA values substituted by label.

Examples

explicit_na(c(NA, "a", "b"))
is.na(explicit_na(c(NA, "a", "b")))

explicit_na(factor(c(NA, "a", "b")))
is.na(explicit_na(factor(c(NA, "a", "b"))))

explicit_na(sas_na(c("a", "")))


tern documentation built on Sept. 24, 2024, 9:06 a.m.