@harry wrote:
I am forming a data frame using dplyr package in R in which I am grouping data set by two variable .
grouping=group_by(pf,age,gender) #pf is the data set and age and gender are variableThen I have created a data frame using dplyr package
pf.fc_by_age_gender=summarise(grouping,mean_friend_count=mean(friend_count),median_friend_count=median(friend_count),n())I want to know why it is necessary to ungroup the data frame before arranging the data frame.
Posts: 1
Participants: 1