Check value labels for (a) value labels with no occurrence in the data (checkEmptyValLabels
) and
(b) values with no value labels (checkMissingValLabels
).
Arguments
- GADSdat
A
GADSdat
object.- vars
Character vector with the variable names to which
checkValLabels()
should be applied.- valueRange
[optional] Numeric vector of length 2: In which range should numeric values be checked? If specified, only numeric values are returned and strings are omitted.
- output
Should the output be structured as a
"list"
or a"data.frame"
?- classes
Character vector with the classes to which
checkMissingLabels()
should be applied. Valid options are"integer"
,"double"
, and"character"
.
Functions
checkEmptyValLabels()
: check for superfluous value labelscheckMissingValLabels()
: check for missing value labels
Examples
# Check a categorical and a metric variable
checkMissingValLabels(pisa, vars = c("g8g9", "age"))
#> $g8g9
#> NULL
#>
checkEmptyValLabels(pisa, vars = c("g8g9", "age"))
#> $g8g9
#> NULL
#>
#> $age
#> NULL
#>
# Check while defining a specific value range
checkMissingValLabels(pisa, vars = c("g8g9", "age", "idschool"),
valueRange = c(0, 5))
#> $g8g9
#> NULL
#>
#> $idschool
#> $idschool$varLabel
#> [1] "School-ID"
#>
#> $idschool$missing_labels
#> [1] 2 3 4 5
#>
#>
checkEmptyValLabels(pisa, vars = c("g8g9", "age", "idschool"),
valueRange = c(0, 5))
#> $g8g9
#> NULL
#>
#> $age
#> NULL
#>
#> $idschool
#> NULL
#>