| isSingular | R Documentation |
A checkFunction that checks if v only
contains a single unique value, aside from missing values. This
function is intended for use as a precheck in makeDataReport.
isSingular(v)
isEmpty(v)
v |
A variable (vector) to check. All variable types are allowed. |
A checkResult with three entires:
$problem (a logical indicating whether v contains only one value),
$message (if a problem was found, a message describing which single
value the variable takes and how many missing observations it contains, otherwise
""), and $problemValues (always NULL).
check, allCheckFunctions,
checkFunction, checkResult
singularVar <- c(rep("a", 10), NA, NA)
notSingularVar <- c("a", "a", "b", "c", "d", "e", "f", NA, NA)
isSingular(singularVar)
isSingular(notSingularVar)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.