print_labels: Print the labels of a labelled vector

Description Usage Arguments Examples

View source: R/labelled.R

Description

This is a convenience function, useful to explore the variables of a newly imported dataset.

Usage

1

Arguments

x

A labelled vector

name

The name of the vector (optional)

Examples

1
2
3
4
5
6
7
s1 <- labelled(c("M", "M", "F"), c(Male = "M", Female = "F"))
s2 <- labelled(c(1, 1, 2), c(Male = 1, Female = 2))
labelled_df <- tibble::data_frame(s1, s2)

for (var in names(labelled_df)) {
  print_labels(labelled_df[[var]], var)
}

tidyverse/haven documentation built on Jan. 11, 2019, 12:13 p.m.