https://github.com/hadley/dplyr
Tip revision: 832b1cb77b6c36cfe24edac49381cd46da2c9491 authored by hadley on 12 April 2017, 16:22:04 UTC
Update sql docs
Update sql docs
Tip revision: 832b1cb
n_distinct.Rd
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/distinct.R
\name{n_distinct}
\alias{n_distinct}
\title{Efficiently count the number of unique values in a set of vector}
\usage{
n_distinct(..., na.rm = FALSE)
}
\arguments{
\item{\dots}{vectors of values}
\item{na.rm}{id \code{TRUE} missing values don't count}
}
\description{
This is a faster and more concise equivalent of \code{length(unique(x))}
}
\examples{
x <- sample(1:10, 1e5, rep = TRUE)
length(unique(x))
n_distinct(x)
}