Skip to content

Instantly share code, notes, and snippets.

@seankross
Created June 7, 2017 18:42
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/aca8e08b41e9cf2c88d73ad858097075 to your computer and use it in GitHub Desktop.
Save seankross/aca8e08b41e9cf2c88d73ad858097075 to your computer and use it in GitHub Desktop.
library(dplyr)
x <- mtcars %>%
group_by(cyl) %>%
sample_frac(replace = TRUE)
mtcars %>%
group_by(cyl) %>%
summarise(sum = n())
x %>%
group_by(cyl) %>%
summarise(sum = n())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment