df <- iris %>%
set_variable_labels(
Sepal.Length = "Length of sepal",
Sepal.Width = "Width of sepal",
Petal.Length = "Length of petal",
Petal.Width = "Width of petal",
Species = "Species"
)
df$Species <- to_labelled(df$Species)
df %>% look_for()
df %>%
update_variable_labels_with(toupper) %>%
look_for()
# accessing variable names with names()
df %>%
update_variable_labels_with(function(x){tolower(names(x))}) %>%
look_for()
df %>%
update_variable_labels_with(toupper, .cols = dplyr::starts_with("S")) %>%
look_for()
df %>%
update_value_labels_with(toupper) %>%
look_for()
Run the code above in your browser using DataLab