% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/ranges-eval.R
\name{n_distinct}
\alias{n_distinct}
\title{Compute the number of distinct unique values in a vector or List}
\usage{
n_distinct(var)
}
\arguments{
\item{var}{a vector of values}
}
\value{
an integer vector
}
\description{
This is a wrapper to \code{length(unique(x))} or
\code{lengths(unique(x))} if \code{x} is a List object
}
\examples{
x <- CharacterList(c("a", "b", "c", "a"),  "d")
n_distinct(x)
n_distinct(unlist(x))
}
