get_labs_df: Get labels of variables

View source: R/utils.R

get_labs_dfR Documentation

Get labels of variables

Description

Get labels of variables

Usage

get_labs_df(.data)

Arguments

.data

tibble or data.frame

Value

tibble with variables and its labels (as list-column)

Examples

# make labels for iris dataset, labels will be colnames
# with dot replaced for whitespace
iris_with_labs <- as.data.frame(mapply(function(x, y) {
  attr(x, "label") <- y
  return(x)
}, iris, gsub("\\.", " ", colnames(iris)), SIMPLIFY = FALSE))

get_labs_df(iris_with_labs)


scholaempirica/reschola documentation built on June 1, 2024, 1:29 p.m.