va_mixed is a wrapper around va on all possible VA notations. By default, c("snellen", "etdrs", "logmar", "snellendec") will be converted - in that order! For tricky cases see details and examples. Note that va_mixed will not notify you from which notation the values were transformed, nor if values were replaced with NA.
va_mixed(x, to = "logmar", possible = c("snellen", "etdrs", "logmar", "quali"))
vector with mixed VA entries
to which notation to be converted
possible VA notations. The order defines which class will be prioritised if a value can be from more than one class, see details. Default = c("snellen", "etdrs", "logmar", "quali")
x <- c(NA, "nlp", 1:2, 1.1, -1, "20/40", "4/6", "6/1000", 34) va_mixed(x, to = "snellen")
va_mixed(x, to = "snellen", possible = c("snellen", "snellendec"))
less than 4" va_mixed(x, to = "snellen", possible = c("snellen", "logmar", "etdrs"))
Mixed entries are challenging, but unfortunately seem to occur in real life data. It will be fairly individual what you have in yours, but it should hopefully not happen that you have all possible notations. Snellen fractions are usually not challenging because they contain a "/", thus are easy to recognize.
Values between 0 and 3 are most problematic,
in particular full integers - this can be EDTRS, snellen decimal notation
or logmar. By default, snellen decimal are not recognized, but you can
specify this with the "possible" argument.
Or, if you know that you don't have any ETDRS value less than 4,
you can safely give precedence to logmar instead, like this:
possible = c("snellen", "logmar", "etdrs")
@examples
Other Ophthalmic functions:
va()
Other VA converter:
VAwrapper
,
plausibility_methods
,
snellen_steps
,
va()
,
va_methods
,
which_va()