melt() reshapes a correlation matrix into a tabular structure by stacking every pair of variables into Var1 and Var2, with their coefficient in value. section 2.5.4
Use the result to prepare a correlation heat map:
- Map Var1 and Var2 to heat-map axes and value to tile color with ggplot2. section 2.5.4
NBA draft correlations
For Age, games played (G), minutes played (MP), Win Shares (WS), and WS48, melt() produces 25 pairwise rows, including repeated matrix relationships and diagonal self-correlations.
