Skip to content
Prev 316081 / 398506 Next

Question on matrix calculation

Or just use aggregate()

# Redefine match_df to match your data.frame
Group.1 V1 V2 V3
1       a  7 17 27
2       c  2  7 12
3       d  6 16 26
# If you really want a matrix:
V1 V2 V3
[1,]  8 23 38
[2,]  5 10 15
[3,]  2  7 12

----------------------------------------------
David L Carlson
Associate Professor of Anthropology
Texas A&M University
College Station, TX 77843-4352