I'd like to make some calculations on FIRST robotics teams and need to build, for lack of better words, a binary interaction matrix. That is when two teams were on the same alliance. Each alliance has three teams, so there are 7 values from each match added to the matrix, when considering (i,j), (j,i), and (i,i).

The full data I'm using is here: <http://frc-events.firstinspires.org/2016/MOKC/qualifications>

But for simplicity, here is an example of 9 teams playing 1 match each.

```
> data.frame(Team.1=1:3,Team.2=4:6,Team.3=7:9)
  Team.1 Team.2 Team.3
1      1      4      7
2      2      5      8
3      3      6      9

```

The matrix should count each binary interaction, (1,4),(4,7),(3,6),(6,3),(9,9), etc, and will be an N x N matrix, where in the above example N=9. Here's the matrix that represents the above lists:

```
> matrix(data=c(1,0,0,1,0,0,1,0,0,+
+ 0,1,0,0,1,0,0,1,0,+
+ 0,0,1,0,0,1,0,0,1,+
+ 1,0,0,1,0,0,1,0,0,+
+ 0,1,0,0,1,0,0,1,0,+
+ 0,0,1,0,0,1,0,0,1,+
+ 1,0,0,1,0,0,1,0,0,+
+ 0,1,0,0,1,0,0,1,0,+
+ 0,0,1,0,0,1,0,0,1),9,9)
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9]
 [1,]    1    0    0    1    0    0    1    0    0
 [2,]    0    1    0    0    1    0    0    1    0
 [3,]    0    0    1    0    0    1    0    0    1
 [4,]    1    0    0    1    0    0    1    0    0
 [5,]    0    1    0    0    1    0    0    1    0
 [6,]    0    0    1    0    0    1    0    0    1
 [7,]    1    0    0    1    0    0    1    0    0
 [8,]    0    1    0    0    1    0    0    1    0
 [9,]    0    0    1    0    0    1    0    0    1

```

In the real data, the team number are not sequential, and are would be more like 5732,1345,3451,etc, and there are more matches per team meaning the matrix values would be between 0 and max number of matches any of the teams played. This can be seen in the real data.

Thanks to anyone that can help.