Hi. I don't understand the error msg:
library(dplyr)
df <- data.frame(x=c("D","D","D","D","E","E","E","E"), y=c(5,3,4,2,4,3,5,2))
data %>%
dplyr::group_by(x) %>%
summarize(avg_value = mean(y))
Error in UseMethod("group_by_") :
no applicable method for 'group_by_' applied to an object of class "function"
Calls: %>% ... summarize -> -> group_by.default -> group_by_
In addition: Warning message:
group_by_()
is deprecated as of dplyr 0.7.0.
Please use group_by()
instead.
Thank you.