Skip to content

Instantly share code, notes, and snippets.

@seankross
Created May 26, 2017 21:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save seankross/4a238e5e3f57328fffa5fb348c63e874 to your computer and use it in GitHub Desktop.
Save seankross/4a238e5e3f57328fffa5fb348c63e874 to your computer and use it in GitHub Desktop.
library(dplyr)
mtcars %>%
group_by(cyl) %>%
summarize(mean(disp))
# # A tibble: 3 × 2
# cyl `mean(disp)`
# <dbl> <dbl>
# 1 4 105.1364
# 2 6 183.3143
# 3 8 353.1000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment