reshape2 melt not producing all pairs
问题 I have a 332 x 332 distance matrix with distances between all possible pairs of stations. I need to transform this matrix into a data.frame with three columns - start.id, end.id, and distance. I have tried the melt function from the reshape2 package but this is not giving the right result Here is a snippet of the data mat 72 79 82 83 116 119 120 127 128 137 143 144 146 147 150 151 152 153 157 160 161 72 NA 6.43 7.458 11.546 3.784 10.252 12.780 4.835 5.230 2.168 10.614 9.806 7.058 6.533 7.117