retrieve_labels: Retrieve labels from labelled data

View source: R/retrieve_labels.R

retrieve_labelsR Documentation

Retrieve labels from labelled data

Description

Retrieve labels from labelled data

Usage

retrieve_labels(data, wide = TRUE)

Arguments

data

labelled data frame

wide

format of return: wide (default) returns a tibble with a single row that contains the variable labels; otherwise, the full data dictionary is returned

Value

a tibble

Examples


dat_labelled <- tibble::tibble(
  var_1 = 1:3,
  var_2 = LETTERS[1:3],
  var_3 = Sys.Date() - 0:2
  ) %>%
  labelled::set_variable_labels(
    var_1 = "Variable 1 (numbers)",
    var_2 = "Variable 2 (letters)",
    var_3 = "Variable 3 (date)"
  )

retrieve_labels(dat_labelled)
retrieve_labels(dat_labelled, wide = FALSE)


pcctc/croquet documentation built on Aug. 10, 2024, 7:04 a.m.