Re: [R] Ordering a matrix by row value in R2.15

2013-03-24 Thread Pete Brecknock
fitz_ra wrote I know this is posted a lot, I've been through about 40 messages reading how to do this so let me apologize in advance because I can't get this operation to work unlike the many examples shown. I have a 2 row matrix temp [,1] [,2] [,3] [,4] [,5]

Re: [R] Ordering a matrix by row value in R2.15

2013-03-24 Thread soon yi
or this with Pete's example orig[,order(orig[2,])] Pete Brecknock wrote fitz_ra wrote I know this is posted a lot, I've been through about 40 messages reading how to do this so let me apologize in advance because I can't get this operation to work unlike the many examples shown. I

Re: [R] Ordering a matrix by row value in R2.15

2013-03-24 Thread William Dunlap
fitz_ra no address I want to order the matrix using the second row in ascending order. From the many examples (usually applied to columns) the typical solution appears to be: temp[order(temp[2,]),] Error: subscript out of bounds That tries to reorder the rows of temp according the