Skip to contents

Replace n.a. (not available) and n.b. (not determined) from lab data with NA

Usage

replace_nanb_with_na(string)

Arguments

string

string

Value

string with NA instead of "n.a." or "n.b." (including 0-10 spaces between "n" and "a"/"b"

Examples

string <- c("19.2", "n.b.", "n. b.", "n.  b.", "n.a.", "n. a.", "n.  a.")
replace_nanb_with_na(string)
#> [1] "19.2" NA     NA     NA     NA     NA     NA