R group by multiple columns and mean value per each group based on different column
问题 data set exist data with age, gender, state, income, group . Group represents the group that each user belongs to: group gender state age income 1 3 Female CA 33 $75,000 - $99,999 2 3 Male MA 41 $50,000 - $74,999 3 3 Male KY 32 $35,000 - $49,999 4 2 Female CA 23 $35,000 - $49,999 5 3 Male KY 25 $50,000 - $74,999 6 3 Male MA 21 $75,000 - $99,999 7 3 Female CA 33 $75,000 - $99,999 8 3 Male MA 41 $50,000 - $74,999 9 3 Male KY 32 $35,000 - $49,999 10 2 Female CA 23 $35,000 - $49,999 11 3 Male KY