我如何订购像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
2 回答
繁星点点滴滴
TA贡献1803条经验 获得超3个赞
确保您使用的是最新发布的ggplot2的最新版本。事情的顺序在旧版本中一直很痛苦,尽管我没有在新版本中尝试过,但是我知道它已经被大量重写和改进,所以我希望他们能够解决这个问题。
- 2 回答
- 0 关注
- 551 浏览
添加回答
举报
0/150
提交
取消