View source: R/modify_variable2.R
px_variable_label | R Documentation |
Inspect or change VARIABLE-LABEL.
The variable label is the name that is shown in the PX-file.
px_variable_label(x, value, validate)
## S3 method for class 'px'
px_variable_label(x, value, validate = TRUE)
x |
A px object |
value |
Optional. A character string or data frame.
|
validate |
Optional. If TRUE a number of validation checks are performed on the px object, and an error is thrown if the object is not valid. If FALSE, the checks are skipped, which can be usefull for large px objects where the check can be time consuming. Use |
A px object, a character string, or a data frame.
# Set VARIABLE-LABEL for individual variables
library(tibble)
x1 <-
px(population_gl) |>
px_variable_label(tribble(~`variable-code`, ~`variable-label`,
'gender', 'Gender',
'age', 'Age'))
px_variable_label(x1)
# Set VARIABLE-LABEL for individual languages
x2 <-
x1 %>%
px_languages(c('en', 'kl')) |>
px_variable_label(tribble(~`variable-code`, ~language, ~`variable-label`,
'gender', 'en', 'Gender',
'gender', 'kl', 'Suiaassuseq',
'age', 'en', 'Age',
'age', 'kl', 'Ukiut'))
px_variable_label(x2)
# Remove VARIABLE-LABEL
x3 <- px_variable_label(x2, NULL)
px_variable_label(x3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.