Skip to content

Instantly share code, notes, and snippets.

@jmcastagnetto
Last active July 11, 2019 17:44
Show Gist options
  • Save jmcastagnetto/e0f1a0cde76bfac2206d to your computer and use it in GitHub Desktop.
Save jmcastagnetto/e0f1a0cde76bfac2206d to your computer and use it in GitHub Desktop.
Simple frequency table using dplyr
> library(dplyr)
> ft <- mtcars %>% group_by(gear) %>% summarise(freq=n())
> ft
Source: local data frame [3 x 2]
gear freq
1 3 15
2 4 12
3 5 5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment