Gives column names and labels
show_labels(df, ...)A tibble with the names of df in the first column and the
labels of df in the second column
If a column has a vector of labels then the first label will be returned.
id <- 1:4
age <- c(83, 29, 64, 40)
bwt <- c(71, 66, 70, 81)
attr(id, "label") <- "Subject ID"
attr(age, "label") <- "Age (years)"
attr(bwt, "label") <- "Weight (kg)"
df <- tibble::tibble(ID = id, AGE = age, BWT = bwt)
show_labels(df)
#> Error in show_labels(df): could not find function "show_labels"
show_labels(df, "AGE", BWT)
#> Error in show_labels(df, "AGE", BWT): could not find function "show_labels"
show_labels(df, 2)
#> Error in show_labels(df, 2): could not find function "show_labels"
show_labels(df, c("BWT", "ID"))
#> Error in show_labels(df, c("BWT", "ID")): could not find function "show_labels"
show_labels(df, tidyselect::starts_with("A"))
#> Error in show_labels(df, tidyselect::starts_with("A")): could not find function "show_labels"