Change or add missing codes of one or multiple variables as part of a GADSdat
object.
Details
Applied to a GADSdat
or all_GADSdat
object, this function is a wrapper of
getChangeMeta
and applyChangeMeta
.
The function supports changing multiple missing tags (missings
) as well as missing tags of
multiple variables (varName
) at once.
Examples
# Set a specific value to missing
pisa2 <- changeMissings(pisa, varName = "computer_age",
value = 5, missings = "miss")
# Set multiple values to missing
pisa3 <- changeMissings(pisa, varName = "computer_age",
value = 1:4,
missings = c("miss", "miss", "miss", "miss"))
# Set a specific value to not missing
pisa4 <- changeMissings(pisa2, varName = "computer_age",
value = 5, missings = "valid")
# Add missing tags to multiple variables
pisa5 <- changeMissings(pisa, varName = c("g8g9", "computer_age"),
value = c(-99, -98), missings = c("miss", "miss"))