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
Read the data:
foo <- read.table(text="1 349 1 393 1 392 4 459 3 49 3 32 2 94")
And sort:
foo[order(foo$V1),]
This relies on the fact that order keeps ties in their original order. See ?order.
order
?order