https://github.com/hadley/dplyr
Raw File
Tip revision: c105a015e651a4b4cb75a8a46ae37b4a7677d9a9 authored by hadley on 20 February 2014, 15:53:17 UTC
Update R CMD check notes
Tip revision: c105a01
grouped_dt.Rd
% Generated by roxygen2 (4.0.0): do not edit by hand
\name{grouped_dt}
\alias{grouped_dt}
\alias{is.grouped_dt}
\title{A grouped data table.}
\usage{
grouped_dt(data, vars)

is.grouped_dt(x)
}
\arguments{
  \item{data}{a tbl or data frame.}

  \item{vars}{a list of quoted variables.}

  \item{x}{an object to check}
}
\description{
The easiest way to create a grouped data table is to call the \code{group_by}
method on a data table or tbl: this will take care of capturing
the unevalated expressions for you.
}
\examples{
if (require("hflights")) {
hflights_dt <- tbl_dt(hflights)
group_size(group_by(hflights_dt, Year, Month, DayofMonth))
group_size(group_by(hflights_dt, Dest))

monthly <- group_by(hflights_dt, Month)
summarise(monthly, n = n(), delay = mean(ArrDelay))
}
}

back to top