removeValLabels {eatGADS}R Documentation

Remove value labels.

Description

Remove value labels of a variable as part of a GADSdat or all_GADSdat object.

Usage

removeValLabels(GADSdat, varName, value, valLabel = NULL)

Arguments

GADSdat

GADSdat object imported via eatGADS.

varName

Character string of a variable name.

value

Numeric values.

valLabel

[optional] Regular expressions in the value labels corresponding to value.

Details

If the argument valLabel is provided the function checks for value and valLabel pairs in the meta data that match both arguments.

Value

Returns the GADSdat object with changed meta data.

Examples

# Remove a label based on value
extractMeta(pisa, "schtype")
pisa2 <- removeValLabels(pisa, varName = "schtype", value = 1)
extractMeta(pisa2, "schtype")

# Remove multiple labels based on value
extractMeta(pisa, "schtype")
pisa3 <- removeValLabels(pisa, varName = "schtype", value = 1:3)
extractMeta(pisa3, "schtype")

# Remove multiple labels based on value - valLabel combination
extractMeta(pisa, "schtype")
pisa4 <- removeValLabels(pisa, varName = "schtype",
                        value = 1:3, valLabel = c("Gymnasium", "other", "several courses"))
extractMeta(pisa4, "schtype")


[Package eatGADS version 1.1.0 Index]