checkEmptyValLabels {eatGADS} | R Documentation |
Check Value Labels
Description
Check value labels for (a) value labels with no occurrence in the data (checkEmptyValLabels
) and
(b) values with no value labels (checkMissingValLabels
).
Usage
checkEmptyValLabels(
GADSdat,
vars = namesGADS(GADSdat),
valueRange = NULL,
output = c("list", "data.frame")
)
checkMissingValLabels(
GADSdat,
vars = namesGADS(GADSdat),
classes = c("integer"),
valueRange = NULL,
output = c("list", "data.frame")
)
Arguments
GADSdat |
A |
vars |
Character vector with the variable names to which |
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 |
classes |
Character vector with the classes to which |
Details
NAs
are excluded from this check. Designated missing codes are reported normally.
Value
Returns a list of length vars
or a data.frame
.
Functions
-
checkEmptyValLabels()
: check for superfluous value labels -
checkMissingValLabels()
: check for missing value labels
Examples
# Check a categorical and a metric variable
checkMissingValLabels(pisa, vars = c("g8g9", "age"))
checkEmptyValLabels(pisa, vars = c("g8g9", "age"))
# Check while defining a specific value range
checkMissingValLabels(pisa, vars = c("g8g9", "age", "idschool"),
valueRange = c(0, 5))
checkEmptyValLabels(pisa, vars = c("g8g9", "age", "idschool"),
valueRange = c(0, 5))