I am trying to make a matrix in R, based on a dataframe with 3 columns: 1st column is names of people in a group, 2nd column is also names of people in a group, 3rd column i