explicit_na {tern}R 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", "")))


[Package tern version 0.9.4 Index]