View source: R/checkMissings.R
checkMissings | R Documentation |
Functions to check if missings are tagged and labeled correctly in a GADSdat
object.
checkMissings(
GADSdat,
missingLabel = "missing",
addMissingCode = TRUE,
addMissingLabel = FALSE
)
checkMissingsByValues(GADSdat, missingValues = -50:-99, addMissingCode = TRUE)
GADSdat |
|
missingLabel |
Single regular expression indicating how missing labels are commonly named in the value labels. |
addMissingCode |
If |
addMissingLabel |
If |
missingValues |
Numeric vector of values which are commonly used for missing values. |
checkMissings()
compares value labels (valLabels
) and missing tags (missings
) of a GADSdat
object and its
meta data information.
checkMissingsByValues()
compares labeled values (value
) and missing tags (missings
) of a GADSdat
object
and its meta data information.
Mismatches are reported and can be automatically adjusted. Note that all checks are only applied to the
meta data information, not the actual data. For detecting missing value labels, see checkMissingValLabels
.
Returns a GADSdat
object with - if specified - modified missing tags.
checkMissings()
: compare missing tags and value labels
checkMissingsByValues()
: compare missing tags and values in a certain range
# checkMissings
pisa2 <- changeValLabels(pisa, varName = "computer_age",
value = 5, valLabel = "missing: No computer use")
pisa3 <- checkMissings(pisa2)
# checkMissingsByValues
pisa4 <- changeValLabels(pisa, varName = "computer_age",
value = c(-49, -90, -99), valLabel = c("test1", "test2", "test3"))
pisa5 <- checkMissingsByValues(pisa4, missingValues = -50:-99)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.