我如何订购像
c("7","10a","10b","10c","8","9","11c","11b","11a","12") -> alph
在
alph[1] "7","8","9","10a","10b","10c","11a","11b","11c","12"
并使用它对data.frame进行排序,例如
V1 <- c("A","A","B","B","C","C","D","D","E","E")V2 <- 2:1 V3 <- alph df <- data.frame(V1,V2,V3)
并排序要获取的行(先依次排序V2和V3)
V1 V2 V3 C 1 9A 1 10a B 1 10c D 1 11b E 1 12A 2 7C 2 8B 2 10b E 2 11a D 2 11c
繁星点点滴滴