% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/utils.R
\name{use_first}
\alias{use_first}
\title{Only use the first element of a vector}
\usage{
use_first(x, indexer = c("[[", "["), .xname = get_name_in_parent(x))
}
\arguments{
\item{x}{Input that should be scalar.}

\item{indexer}{Either double indexing, \code{"[["} (the default) or
single indexing \code{"["}.}

\item{.xname}{Not intended to be used directly.}
}
\value{
If \code{x} is scalar, it is returned unchanged, otherwise
only the first element is returned, with a warning.
}
\description{
If the input is not scalar, then only the first element is returned, 
with a warning.
}
\examples{
dont_stop(use_first(1:5))
}
