if (require("data.table")) {
data("hflights", package = "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))
}
Run the code above in your browser using DataLab