Skip to content

Instantly share code, notes, and snippets.

@daranzolin
Last active November 7, 2018 02:27
Show Gist options
  • Select an option

  • Save daranzolin/584739d2fc0c2e0c39e0acdc2dc23667 to your computer and use it in GitHub Desktop.

Select an option

Save daranzolin/584739d2fc0c2e0c39e0acdc2dc23667 to your computer and use it in GitHub Desktop.
library(tidyverse)
my_summarise <- function(df, group_var) {
group_var <- rlang::enquo(group_var)
df %>%
group_by(!! group_var) %>%
summarise(a = mean(Petal.Length))
}
### Run ViewPipeSteps addin
iris %>%
my_summarise(Species) %>%
filter(Species == "setosa")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment