grouped_dt: A grouped data table.

Description Usage Arguments Examples

View source: R/grouped-dt.r

Description

The easiest way to create a grouped data table is to call the group_by method on a data table or tbl: this will take care of capturing the unevalated expressions for you.

Usage

1
2
3

Arguments

data

a tbl or data frame.

vars

a list of quoted variables.

copy

If TRUE, will make copy of input.

x

an object to check

Examples

1
2
3
4
5
6
7
8
9
library(dplyr, warn.conflicts = FALSE)
if (require("nycflights13")) {
flights_dt <- tbl_dt(flights)
group_size(group_by(flights_dt, year, month, day))
group_size(group_by(flights_dt, dest))

monthly <- group_by(flights_dt, month)
summarise(monthly, n = n(), delay = mean(arr_delay))
}

hadley/dtplyr documentation built on June 5, 2017, 12:01 p.m.