R数据框排序方法

v1<-c("bily","tom","jhon")
v2<-c(23,45,26)
#构造数据框
x<-data.frame(name=v1,age=v2,)
x
x[order(x$age),]
x[order(x$name),]