https://github.com/hadley/dplyr
Tip revision: ebdf223645c12acab50d6ebbbcafe8da8be5f1ed authored by Kirill Müller on 09 November 2018, 20:54:32 UTC
valr
valr
Tip revision: ebdf223
n.Rd
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/manip.r
\name{n}
\alias{n}
\title{The number of observations in the current group.}
\usage{
n()
}
\description{
This function is implemented specifically for each data source and can only
be used from within \code{\link[=summarise]{summarise()}}, \code{\link[=mutate]{mutate()}} and
\code{\link[=filter]{filter()}}.
}
\examples{
if (require("nycflights13")) {
carriers <- group_by(flights, carrier)
summarise(carriers, n())
mutate(carriers, n = n())
filter(carriers, n() < 100)
}
}