tidyNA: Tidy NA entries to actual NA values

Description Usage Arguments Details Value Examples

View source: R/va_cleaner.R

Description

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

Usage

1
2
3
4
5
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", "^-$").

Details

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

Value

character vector

Examples

1
2
3
4
5
6
7
8
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)

eye documentation built on Sept. 5, 2021, 5:25 p.m.