SyntaxFix
Write A Post
Hire A Developer
Questions
Another option, not necesarily more elegant, but does not require to refer to a specific column:
mtcars %>% group_by(cyl, gear) %>% do(data.frame(nrow=nrow(.)))