View source: R/removeValLabels.R
removeValLabels | R Documentation |
Remove value labels of a variable as part of a GADSdat
or all_GADSdat
object.
removeValLabels(GADSdat, varName, value, valLabel = NULL)
GADSdat |
|
varName |
Character string of a variable name. |
value |
Numeric values. |
valLabel |
[optional] Regular expressions in the value labels corresponding to |
If the argument valLabel
is provided the function checks for value
and valLabel
pairs in the
meta data that match both arguments.
Returns the GADSdat
object with changed meta data.
# 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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.