Given the list of animals, name it m, which contains
$bob
[1] 3
$ryan
[1] 4
$dan
[1] 1
How can I sort this guy by numerical value? Basically, I would like my code to look like this:
m=sort(m,sortbynumber)
$ryan
[1] 4
$bob
[1] 3
$dan
[1] 1
I can’t figure it out, unfortunately. Sounds like a simple solution.
source
share