# NOT RUN {
library(dplyr)
# Important: Always name the field and
# prefix the function with `!!`` (See Details)
# Uses the default 30 bins
mtcars %>%
group_by(x = !!db_bin(mpg)) %>%
tally()
# Uses binwidth which overrides bins
mtcars %>%
group_by(x = !!db_bin(mpg, binwidth = 10)) %>%
tally()
# }
Run the code above in your browser using DataLab