tidyNA {eye} | R Documentation |
Creates tidy NA entries - NA equivalent strings are tidied to actual NA values
tidyNA(x, ...)
tidyNA_low(x, ...)
isNAstring(x, string = NULL, defaultstrings = TRUE)
x |
Vector |
... |
passed to isNAstring |
string |
vector of full strings to be replaced by NA |
defaultstrings |
by default (TRUE), the following strings will be replaced by NA values: c("\.+", "", "\s+", "n/a", "na", "null", "^-$"). |
tidyNA_low is an internal function used for VA cleaning returning a lower case vector.
character vector
x <- c("a", " ", ".", "-", "NULL")
tidyNA(x)
# in addition to the default strings, a new string can be added
tidyNA(x, string = "a")
# or just remove the strings you want
tidyNA(x, string = "a", defaultstrings = FALSE)