Skip to content

Instantly share code, notes, and snippets.

@cddesja
Last active February 27, 2020 15:27
Show Gist options
  • Save cddesja/5537dd232e661f25f1e24ca276fd6801 to your computer and use it in GitHub Desktop.
Save cddesja/5537dd232e661f25f1e24ca276fd6801 to your computer and use it in GitHub Desktop.
# untidyverse
# this one is sooooooo hard to type
an.agg <- aggregate(bmi ~ an_j + months,
FUN = function(x) c(m = mean(x), n = n(x)),
data = an.l)
# tidyverse
# this one makes my fingers sing
bmi %>%
group_by(an_j) %>%
summarize(m = mean,
n = n)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment