Skip to content

Instantly share code, notes, and snippets.

@ctufts
Created July 11, 2016 19:56
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save ctufts/eaca046a72af650a9b12f9751d95ff8d to your computer and use it in GitHub Desktop.
Save ctufts/eaca046a72af650a9b12f9751d95ff8d to your computer and use it in GitHub Desktop.
dplyr group_by and ggplot example
plot_df <-df %>% group_by(feature) %>%
do(
plots = ggplot(data = .) + aes(x = xcol, y = ycol) +
geom_point() + ggtitle(.$feature)
)
# show plots
plot_df$plots
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment