% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/labelled.R
\name{print_labels}
\alias{print_labels}
\title{Print the labels of a labelled vector}
\usage{
print_labels(x, name = NULL)
}
\arguments{
\item{x}{A labelled vector}

\item{name}{The name of the vector (optional)}
}
\description{
This is a convenience function, useful to explore the variables of
a newly imported dataset.
}
\examples{
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::tibble(s1, s2)

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