https://github.com/hadley/dplyr
Raw File
Tip revision: 1f57c48a765ad60837ffed1fe0572c40f4b7a3de authored by hadley on 09 January 2015, 12:35:47 UTC
Merge branch 'master' of github.com:hadley/dplyr
Tip revision: 1f57c48
n.Rd
% Generated by roxygen2 (4.1.0): 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 special for each data source and can only
be used from within \code{\link{summarise}}, \code{\link{mutate}} and
\code{\link{filter}}
}
\examples{
if (require("nycflights13")) {
carriers <- group_by(flights, carrier)
summarise(carriers, n())
mutate(carriers, n = n())
filter(carriers, n() < 100)
}
}

back to top