% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/data_plots.R
\name{get_label}
\alias{get_label}
\title{Print label, and if missing print variable name}
\usage{
get_label(data, var = NULL)
}
\arguments{
\item{data}{vector or data frame}

\item{var}{variable name. Optional.}
}
\value{
character string
}
\description{
Print label, and if missing print variable name
}
\examples{
mtcars |> get_label(var = "mpg")
mtcars |> get_label()
mtcars$mpg |> get_label()
gtsummary::trial |> get_label(var = "trt")
gtsummary::trial$trt |> get_label()
1:10 |> get_label()
}
