Learn R Programming

eye (version 1.2.1)

tidyNA: Tidy NA entries to actual NA values

Description

Creates tidy NA entries - NA equivalent strings are tidied to actual NA values

Usage

tidyNA(x, ...)

tidyNA_low(x, ...)

isNAstring(x, string = NULL, defaultstrings = TRUE)

Arguments

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", "^-$").

Value

character vector

Details

tidyNA_low is an internal function used for VA cleaning returning a lower case vector.

Examples

Run this code
# NOT RUN {
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)
# }

Run the code above in your browser using DataLab