
Last chance! 50% off unlimited learning
Sale ends in
A checkFunction to be called from check
that identifies prefixed and suffixed whitespace(s) in character,
(haven_)labelled or factor variables.
identifyWhitespace(v, nMax = 10)
A character, (haven_)labelled or factor variable to check.
The maximum number of problematic values to report.
Default is 10
. Set to Inf
if all problematic values are to be included
in the outputted message, or to 0
for no output.
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.
# NOT RUN {
identifyWhitespace(c("a", " b", "c", "d ", "e "))
# }
Run the code above in your browser using DataLab