I want to make a data frame which has the mean and median of friend_count variable which is from another data frame 'pf' by the function group_by() and summarise().
But when I try this command, the result is like below, showing the mean and median of the whole column of friend_count without grouping by age.
Please help!
library(dplyr)
pf.fc_by_age <- pf %>% group_by(age) %>%
summarise(friend_count_mean = mean(friend_count),
friend_count_median = median(friend_count))
pf.fc_by_age
friend_count_mean friend_count_median
1 196.3508 82
plyr
as well. Use%>% dplyr::summarise(friend_count_mean=
– akrunpackage::function()
instead of onlyfunction()
. While you might have other bugs, it would not be because of package conflicts/masking ;) – DJV