R语言中排序函数order、rank、sort 1、测试1 a <- c(3,7,4,1) order(a) ## 返回从小到大排序的索引 rank(a) ## 返回元素从小到大的排名 sort(a) ## 直接对元素从小到大排序