View source: R/recode_vallab.R
recode_vallab | R Documentation |
Recode value labels based on numeric code
recode_vallab(x, code, new_label)
x |
haven_labelled vector to be passed through. |
code |
Numeric value that specifies code where value label is to be replaced. |
new_label |
Character string to be used as the new value label. |
x <- haven::labelled(c(1,2,3,2,1),c("a" = 1, "b" = 2, "d" = 3))
recode_vallab(x, code = 2, new_label = "Surprise!")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.