group_size {dplyr} | R Documentation

## Calculate group sizes.

### Description

Calculate group sizes.

### Usage

    group_size(x)

    n_groups(x)

### Arguments

`x` | a grouped tbl

### See Also

Other grouping functions: `group_by_all`, `group_by`, `group_indices`, `group_keys`, `group_map`, `group_nest`, `group_rows`, `group_trim`, `groups`

### Examples

    if (require("nycflights13")) {

    by_day <- flights %>% group_by(year, month, day)
    n_groups(by_day)
    group_size(by_day)

    by_dest <- flights %>% group_by(dest)
    n_groups(by_dest)
    group_size(by_dest)
    }

[Package dplyr version 0.8.0.1 Index]