set_labels | R Documentation |
Assign data labels to specified variables
set_labels(tbl, dict, vars = NULL, ignore_case = FALSE, warn = TRUE)
tbl |
data.frame: Data.frame with the data |
dict |
data.frame: Dictionary with all the data labels to use |
vars |
character: If specified, only labels are assigned to those variables |
ignore_case |
logical: Indicate if case sensitive should be ignored. |
warn |
logical: Indicate if warnings should be shown. |
The data entered in the tbl
argument but with data labels
Data labels vignette("labeler", package = "labeler")
## Not run:
dict <- list(
SEX = list(
lab = "Sex of the person",
labs = c(
"Man" = 1,
"Woman" = 2
)
)
)
df <- data.frame(SEX = c(1, 2))
str(df)
str(set_labels(df, dict = dict))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.