Learn R Programming

eye (version 0.1.0)

clean_va: Visual acuity entry cleaner

Description

VA cleaning:

  1. isNAstring(): Replacing empty placeholders (".","", "(any number of empty space)", "NULL", "NA", "N/A" ) - any cases - with NA

  2. convert_NLP() Simplifying the notation for qualitative VA notation (NPL becomes NLP, PL becomes LP)

  3. Removing non-Snellen character strings

Usage

clean_va(x, quali = c("nlp", "lp", "hm", "cf"))

convert_NLP(x, replace_PL = c(pl = "lp", npl = "nlp"), tolower = TRUE)

isNAstring( x, full = c("\\.+", "", "\\s+", "n/a", "na", "null"), tolower = TRUE )

Arguments

x

Vector with VA entries

quali

strings for qualitative visual acuity entries

replace_PL

named vector how to rename qualitative VA

tolower

if TRUE, x will be converted to lower first

full

vector of full strings to be replaced by NA

Value

character vector

See Also

Other VA cleaner: va()

Other VA cleaner: va()