% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/prep_card.R
\name{prep_label}
\alias{prep_label}
\title{Prepare label}
\usage{
prep_label(df)
}
\arguments{
\item{df}{(data.frame)}
}
\value{
a data.frame with a \code{label} column (if the input has the required
columns) or the input unchanged.
}
\description{
\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#experimental}{\figure{lifecycle-experimental.svg}{options: alt='[Experimental]'}}}{\strong{[Experimental]}}

Adds a \code{label} column which is a combination of \code{stat_label} (for continuous
variables) and \code{variable_level} (for categorical ones) if these 2 columns are
present in the input data frame.
}
\examples{
df <- data.frame(
  variable_level = c("d", "e", "f"),
  stat_label = c("a", "b", "c"),
  stat_name = c("n", "N", "n"),
  context = c("categorical", "continuous", "hierarchical")
)

prep_label(df)
}
