label_normalize removes special characters, whitespace, and other typical typing errors.

label_normalize(x)

var_label_normalize(x)

val_label_normalize(x)

Arguments

x

A character vector of labels to be normalized.

Details

var_label_normalize changes the vector to snake_case. val_label_normalize removes possible chunks from question identifiers.

The functions var_label_normalize and val_label_normalize may be differently implemented for various survey series.

See also

Examples

label_normalize ( c("Don't know", " TRUST", "DO NOT TRUST", "inap in Q.3", "Not 100%", "TRUST < 50%", "TRUST >=90%", "Verify & Check", "TRUST 99%+"))
#> [1] "do not know" "trust" "do not trust" #> [4] "inap in q 3" "not 100 pct" "trust lt 50 pct" #> [7] "trust ge 90 pct" "verify and check" "trust 99 pct plus"
var_label_normalize ( c("Q1_Do you trust the national government?", " Do you trust the European Commission") )
#> [1] "do you trust the national government" #> [2] "do you trust the european commission"
val_label_normalize ( c("Q1_Do you trust the national government?", " Do you trust the European Commission") )
#> [1] "do_you_trust_the_national_government" #> [2] "do_you_trust_the_european_commission"