I have a list of rules,
rulelist ={$x1 -> 1, $x10 -> 15, $x11 -> 1, $x2 -> 6, $x3 -> 15, $x4 -> 15, $x5 -> 10, $x6 -> 60, $x7 -> 20, $x8 -> 15, $x9 -> 45}
Trying SortBy[rulelist, Greater]
keeps the rulelist the way it is, and trying SortBy[rulelist, Last]
gives
{$x1 -> 1, $x11 -> 1, $x2 -> 6, $x5 -> 10, $x10 -> 15, $x3 -> 15, $x4 -> 15, $x8 -> 15, $x7 -> 20, $x9 -> 45, $x6 -> 60}
How can I order these rules in numerical instead of canonical order?
SortBy[rulelist, Last]
? $\endgroup$$x1
with$x01
work for you? By renaming the variables in that way, a standardSort
would do the job. $\endgroup$