I can summarise a data frame with dplyr like this:
dplyr
mtcars %>% group_by(cyl) %>% summarise(mean(mpg))
To convert the output b
In addition to what G. Grothendieck mentioned above, you can convert it into a new dataframe:
new_summary <- mtcars %>% group_by(cyl) %>% summarise(mean(mpg)) %>% as.data.frame()