Sort matrix according to first column in R

后端 未结 5 1375
抹茶落季
抹茶落季 2020-12-07 17:50

I have a matrix with two columns of the following form:

1 349
1 393
1 392
4 459
3 49
3 32
2 94

I would like to sort this matrix in increasi

5条回答
  •  既然无缘
    2020-12-07 18:11

    If your data is in a matrix named foo, the line you would run is

    foo.sorted=foo[order[foo[,1]]

提交回复
热议问题