Learn R Programming

dplyr (version 0.5.0)

n: The number of observations in the current group.

Description

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

Usage

n()

Arguments

Examples

Run this code
if (require("nycflights13")) {
carriers <- group_by(flights, carrier)
summarise(carriers, n())
mutate(carriers, n = n())
filter(carriers, n() < 100)
}

Run the code above in your browser using DataLab