View source: R/transforms_text.R
blank_to_missing | R Documentation |
Convert whitespace to a missing value
blank_to_missing(x, missing_value = NA)
x |
A character vector |
missing_value |
Defaults to NA, but can be used to convert all whitespace values to a single character value |
Given a character vector, this function replaces entries that contain *only* whitespace with the missing_value provided. Entries such as empty strings "", any number of spaces " ", " ", tab ("\t"), newline ("\n"), and carriage return ("\r") are converted to the missing_value.
the modified character vector
blank_to_missing(c("A","B","C"," ", " ", "\t", " he", "hi\t",123,"\n", "two\nlines", ""))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.