0

I am not able to work this example from tidyverse https://dplyr.tidyverse.org/reference/summarise.html

>mtcars %>% group_by(cyl) %>% summarise(mean = mean(disp))
mean
1 230.7219

What might be wrong ?

PDM
  • 84
  • 10
  • 2
    It looks like you probably have loaded `plyr` after `dplyr` (part of `tidyverse`) and ignored the warning - the older `plyr` package has a version of `summarize` that doesn't respect grouping. You can fix an instance by specifying `dplyr::summarise` instead of just `summarise`, but in general if you need the `plyr` package load it *before* you load `dplyr`. – Gregor Thomas Nov 06 '20 at 17:39
  • oh thats right. Thank you. – PDM Nov 06 '20 at 17:42

0 Answers0