n: The number of observations in the current group.

Description Usage Examples

View source: R/manip.r

Description

This function is implemented special for each data source and can only be used from within summarise, mutate and filter

Usage

1
n()

Examples

1
2
3
4
5
6
if (require("nycflights13")) {
carriers <- group_by(flights, carrier)
summarise(carriers, n())
mutate(carriers, n = n())
filter(carriers, n() < 100)
}


dplyr documentation built on May 20, 2017, 1:14 a.m.
Search within the dplyr package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

Please suggest features or report bugs in the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.