identifyWhitespace: A checkFunction for identifying whitespace

Description Usage Arguments Value See Also Examples

View source: R/identifyWhitespace.R

Description

A checkFunction to be called from check that identifies prefixed and suffixed whitespace(s) in character, (haven_)labelled or factor variables.

Usage

1
identifyWhitespace(v, nMax = 10)

Arguments

v

A character, (haven_)labelled or factor variable to check.

nMax

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.

Value

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.

See Also

check, allCheckFunctions, checkFunction, checkResult

Examples

1
 identifyWhitespace(c("a", " b", "c", "d ", "e  "))

dataReporter documentation built on Nov. 11, 2021, 9:06 a.m.