Hi, I have a problem. I have a data frame looking like: ID val
A .3 B 1.2 C 3.4 D 2.2 E 2.0 I need to CREATE the following TABLE: CASE DIFF A-A 0 A-B -0.9 A-C -3.1 A-D -1.9 A-E -1.7 B-A ... B-B ... B-C B-D B-E C-A C-B C-C C-D C-E D-A D-B D-C D-D D-E E-A E-B E-C E-D E-E WHERE CASE IS THE COUPLE OF ELEMENTS CONSIDEREDM AND DIFF IS THE computed DIFFERENCE between their values. Could you give me suggestions? Alessandro Carletti ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.