% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/utils.R
\name{.unique_and_sorted}
\alias{.unique_and_sorted}
\title{ARD-flavor of unique()}
\usage{
.unique_and_sorted(x, useNA = c("no", "always"))
}
\arguments{
\item{x}{(\code{any})\cr
a vector}
}
\value{
a vector
}
\description{
Essentially a wrapper for \code{unique(x) |> sort()} with \code{NA} levels removed.
For factors, all levels are returned even if they are unobserved.
Similarly, logical vectors always return \code{c(TRUE, FALSE)}, even if
both levels are not observed.
}
\examples{
cards:::.unique_and_sorted(factor(letters[c(5, 5:1)], levels = letters))

cards:::.unique_and_sorted(c(FALSE, TRUE, TRUE, FALSE))

cards:::.unique_and_sorted(c(5, 5:1))
}
\keyword{internal}
