I have this matrix of distances. I want to sort the values in the rows in ascending order so row 1 should look like
388.8342 396.9244 405.8091 423.8408 480.4186 487.3038
The 2nd row also should be sorted in ascending order
I tried doing nearest <- distances[order(distances)]
nearest
but it is not the result that I want.