Sorting a key,value list in R by value
You can try order
m[order(-unlist(m))]
#$ryan
#[1] 4
#$bob
#[1] 3
#$dan
#[1] 1
Or a slightly more efficient option would be to use decreasing=TRUE
argument of order
(from @nicola's comments)
m[order(unlist(m), decreasing=TRUE)]