% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/utils_labels.R
\name{get_var_label}
\alias{get_var_label}
\title{Retrieve variable labels from OKX data frames}
\usage{
get_var_label(df, var = NULL, default = NA_character_)
}
\arguments{
\item{df}{A \code{data.frame} with \code{"var_labels"} attribute (as returned by OKX API parsers).}

\item{var}{Optional variable name (character) or index (numeric). If \code{NULL}, all labels are returned.}

\item{default}{Value to return if the variable has no label (default: \code{NA_character_}).}
}
\value{
A character label if \code{var} is provided, or a named character vector of all labels if \code{var = NULL}.
}
\description{
Returns human-readable labels attached to a data frame produced by OKX API parsers.
You can retrieve all labels or a label for a specific variable by name or index.
}
\examples{
df <- data.frame(ordId = "123", px = 10)
attr(df, "var_labels") <- c(ordId = "Order ID", px = "Price")

get_var_label(df, "ordId")
get_var_label(df, 2)
get_var_label(df)

}
