Skip to contents

Turn NA into "NA"

Usage

str_replace_na(string, replacement = "NA")

Arguments

string

Input vector. Either a character vector, or something coercible to one.

replacement

A single string.

Value

A character vector the same length as string, with missing values replaced by replacement.

Examples

str_replace_na(c(NA, "abc", "def"))
#> [1] "NA"  "abc" "def"