Timeline for Sort (order) data frame rows by multiple columns
Current License: CC BY-SA 4.0
17 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Feb 23, 2023 at 7:25 | history | notice added | Sotos | Recommended answer in R Language | |
| Feb 23, 2023 at 7:25 | history | notice removed | Sotos | Recommended answer in R Language | |
| Feb 23, 2023 at 7:25 | history | notice added | Sotos | Recommended answer in R Language | |
| Mar 25, 2021 at 13:18 | review | Suggested edits | |||
| Mar 25, 2021 at 13:38 | |||||
| Sep 21, 2018 at 13:42 | history | edited | Mus | CC BY-SA 4.0 | deleted 1 character in body |
| Mar 24, 2015 at 11:40 | comment | added | Richie Cotton | The "invalid argument to unary operator" error occurs when you use minus with a character column. Solve it by wrapping the column in xtfrm, for example dd[ order(-xtfrm(dd[,4]), dd[,1]), ]. | |
| Mar 24, 2015 at 11:38 | history | rollback | Richie Cotton | Rollback to Revision 4 | |
| Mar 24, 2015 at 7:34 | history | edited | Richie Cotton | CC BY-SA 3.0 | dealing with "invalid argument to unary operator" error |
| Jul 30, 2014 at 22:11 | comment | added | HattrickNZ | why is dd[ order(-dd[,4],, ] not valid or 'dd[ order(-dd[,4], ]' basically why is dd[,1] required? is -dd[,4] not enough if you just want to sort by 1 column? | |
| Jan 15, 2014 at 3:35 | history | edited | Dirk is no longer here | CC BY-SA 3.0 | Correct link to **order()** not sort() |
| S Jan 15, 2014 at 0:26 | history | suggested | Uli Köhler | CC BY-SA 3.0 | Added order doclink |
| Jan 15, 2014 at 0:23 | review | Suggested edits | |||
| S Jan 15, 2014 at 0:26 | |||||
| Oct 21, 2012 at 14:36 | history | edited | Dirk is no longer here | CC BY-SA 3.0 | added 398 characters in body |
| Oct 21, 2012 at 14:34 | comment | added | Dirk is no longer here | Easy enough: dd[ order(-dd[,4], dd[,1]), ], but can't use with for name-based subsetting. | |
| Mar 27, 2012 at 12:41 | comment | added | Dirk is no longer here | Should work the same way, but you can't use with. Try M <- matrix(c(1,2,2,2,3,6,4,5), 4, 2, byrow=FALSE, dimnames=list(NULL, c("a","b"))) to create a matrix M, then use M[order(M[,"a"],-M[,"b"]),] to order it on two columns. | |
| Aug 18, 2009 at 22:09 | vote | accept | Christopher DuBois | ||
| Aug 18, 2009 at 21:51 | history | answered | Dirk is no longer here | CC BY-SA 2.5 |