I have created a table from my dataframe(no.out) using only 1 variable(DX_2_CD).
> counts <- table(no.out$DX_2_CD)
> counts
Blood CirculatorySystems Congenital Digestive Genitourinary
7 133 0 7 35
Illdefined Immunity Infectious Injury Mental
126 98 0 84 7
Muscular Neoplasms Nervous Perinatal Pregnancy
119 7 0 0 7
Respiratory Sense Skin
63 35 63
Now, I want to re-arrange counts in ascending order, such that the lowest value is first and the highest value is the last. If there are two values which are the same, it does not matter which comes first.
I think the simplest solution is using order():
or, even better, sort():