Consider the list l
as:
l<-list(a=24,b=12,c=30,d=1)
how to get a sorted version on the values of such a list while preserving the names?
In the results list, the order of elements should be as follows: d
, b
, a
and c
corresponding to the sequence 1,12,24,30.
source
to share