Given the table below:
X =
col1 col2 col3
row1 "A" "A" "1.0"
row2 "A" "B" "0.9"
row3 "A" "C" "0.4"
row4 "B" "A" "0.9"
row5 "B" "B" "1.0"
row6 "B" "C" "0.2"
row7 "C" "A" "0.4"
row8 "C" "B" "0.2"
row9 "C" "C" "1.0"
Where col3 is a correlation measure between pairs of entities in col1 and col2.
How can I construct a matrix for which the column names are col1, the row names are col2, and the values in the cells of the matrix are populated by col3?