data #dataframe对象 含有v1,v2两列
data[sort(data$v1,index.return=TRUE)$ix,] #对data的数据按v1排列,v1须为numeric as.numeric()