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
Creating a data.table with key=V1 automatically does this for you. Using Stephan's data foo
data.table
key=V1
foo
> require(data.table) > foo.dt <- data.table(foo, key="V1") > foo.dt V1 V2 1: 1 349 2: 1 393 3: 1 392 4: 2 94 5: 3 49 6: 3 32 7: 4 459