I have a data frame which looks like this :
a = c("1A","10A","11A","2B","2C","22C","3A","3B")
b= c(1,2,3,4,5,6,7,8)
ab = data.frame(a,b)
and I want to sort it according to the column a
. I tried the mixed order
library(gtools)
ab[mixedorder(ab$a),]
but I don' t get the result I want (1A,2B,2C,3A,3B..). How can I fix this?