I'm creating a heatmap with discrete X and discrete Y axis. The discrete Y axis is numerical (BEST12.) but yaxis discreteorder=formatted
and discreteorder=unformatted
are both sorting the variable lexigraphicly.
Expected: 1 2 3 4 5 ... 10 11 12 ... 20 Actual: 1 10 11 ... 2 20 21 ....
How do I force a numerical sort order?
proc sgplot data=Heatmap;
yaxis discreteorder=formatted;
heatmap x=Battalion y=StationArea / name='HeatMap' discretey discretex
colorresponse=arrive_seconds colorstat=mean;
gradlegend 'HeatMap';
run;
**EDIT for Stu's suggestion to use 'proc sort' and then omit 'discreteorder' :
The result then is that the first values on the y axis are only the StationAreas that B01 have responded to.
Try filling in the missing cells so that all of the Battalion values are present on the first StationArea. Now the default DATA order should work.