# Examples library(dplyr) source("s_dplyr.R"); # Original usage of dplyr mtcars %>% filter(gear == 3,cyl == 8) %>% select(mpg, cyl, hp:vs) # Select user specified cols. # Note that you can have a vector of strings # or a single string separated by ',' or a mixture of both cols = c("mpg","cyl, hp:vs") mtcars %>% filter(gear == 3,cyl == 8) %>% s_select(cols) # Filter using a string col = "gear" mtcars %>% s_filter(paste0(col,"==3"), "cyl==8" ) %>% select(mpg, cyl, hp:vs) # Arrange without using %>% s_arrange(mtcars, "-mpg, gear, carb") # group_by and summarise with strings mtcars %>% s_group_by("cyl") %>% s_summarise("mean(disp), max(disp)") mtcars %>% s_group_by("cyl") %>% s_summarise(paste(paste0("mean(", colnames(mtcars),")"), collapse=","))