A checkFunction to be called from check
that identifies prefixed and suffixed whitespace(s) in character,
labelled or factor variables.
identifyWhitespace(v, nMax = 10)
v | A character, labelled or factor variable to check. |
---|---|
nMax | The maximum number of problematic values to report.
Default is |
A checkResult
with three entires:
$problem
(a logical indicating whether any whitespaces were
fount), $message
(a message describing which values were prefixed
or suffixed with whitespace) and $problemValues
(the problematic
values). Note that only unique values are printed in the message, and that
they are sorted alphabetically.
identifyWhitespace(c("a", " b", "c", "d ", "e "))#> The following values appear with prefixed or suffixed white space: b, d , e .