https://github.com/hadley/dplyr
Tip revision: 0a7bbc5175accd041293502e87424f1b93c959f2 authored by Kirill Müller on 17 December 2018, 16:37:51 UTC
Merge pull request #4025 from tidyverse/r-0.7.8-docs
Merge pull request #4025 from tidyverse/r-0.7.8-docs
Tip revision: 0a7bbc5
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}{if \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)
}