You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
can' t sort on multiple columns in data viewer #1691
I tried shift and click but it just select the column (the arrow turns blue) but no sorting occurs.
For example here I sorted by column "a" decreasing then wanted to sort by "c" column but nothing happens apart the arrow becoming blue
View(data.frame(a = rep(1:4, each = 3), b = 1:3, c = 1:2))
I use the Fedora build by the way on SLED Rstudio version 1.1.383
@adamconroy I'm seeing somewhat unexpected behavior with the sorting. (1.4.484)
First, I don't know if it's just me, but based on the order of clicking I would assume the same order of sorting. For example... View(data.frame(a = rep(1:4, each = 3), b = 1:3, c = 1:2))
If I first click on A and then shift-click on B, I would expect first to be sorted by A THEN sorted by B. It does the opposite in this case. This is what I first expected when playing with it but I'd be willing to accept it if others think differently.
I then tried out using it to sort more than two columns and that's where I got really confused. Example... View(data.frame(a = rep(1:4, each = 3), b = 1:3, c = 1:2))
Click column A
A column sorted first
Shift click column B
B column sorted first then column A
Shift click column C
C column sorted first then A then B
I would expect it to go in reverse order C B A instead of C A B if we are going backward. Is this expected? Hopefully, this makes sense!
@dfalty unfortunately the way that the sorting works is up to the R sorting algorithm. I spent a fair amount of time going back and forth with Hadley other R folk and just to get any manner of multisort. I agree it feels a bit wonky. I'll make an additional issue for making this feel better but it's going to require some extra effort. I found it kind of funny how tricky this is to do in R considering the primary purpose of R is data manipulation/analysis. 🤣
This was a case of "it didn't work at all before, now at least it kind of works" so we have something now but it should be improved.
Is there any tutorial for this? I spent 5 minutes shift-clicking on headers and still not getting a double sort on two columns: 1 Character (ascending) 2. Numeric. (ascending)
@astraetech What version of RStudio, R, and operating system are you using? I just tried it in RStudio Desktop RStudio-2022.07.1+554 and RStudio-2022.11.0-daily+135 on MacOS 13 as a starting point, and I'm able to get multiple column selection with Shift-Click.
Activity
dfalty commentedon Oct 30, 2017
I'm able to reproduce this on the latest daily as well 1.2.140-3.
Chesster1883 commentedon Oct 17, 2019
Still able to replicate this bug using RStudio v1.2.5001 on Windows with the following:
View(iris)
Sort of Sepal.Length
Shift click to sort on Sepal.Width
dfalty commentedon Jun 18, 2020
@adamconroy I'm seeing somewhat unexpected behavior with the sorting. (1.4.484)
First, I don't know if it's just me, but based on the order of clicking I would assume the same order of sorting. For example...
View(data.frame(a = rep(1:4, each = 3), b = 1:3, c = 1:2))If I first click on A and then shift-click on B, I would expect first to be sorted by A THEN sorted by B. It does the opposite in this case. This is what I first expected when playing with it but I'd be willing to accept it if others think differently.
I then tried out using it to sort more than two columns and that's where I got really confused. Example...
View(data.frame(a = rep(1:4, each = 3), b = 1:3, c = 1:2))A column sorted first
B column sorted first then column A
C column sorted first then A then B
I would expect it to go in reverse order C B A instead of C A B if we are going backward. Is this expected? Hopefully, this makes sense!
adamconroy commentedon Jun 18, 2020
@dfalty unfortunately the way that the sorting works is up to the R sorting algorithm. I spent a fair amount of time going back and forth with Hadley other R folk and just to get any manner of multisort. I agree it feels a bit wonky. I'll make an additional issue for making this feel better but it's going to require some extra effort. I found it kind of funny how tricky this is to do in R considering the primary purpose of R is data manipulation/analysis. 🤣
This was a case of "it didn't work at all before, now at least it kind of works" so we have something now but it should be improved.
dfalty commentedon Jun 18, 2020
Gotcha, thanks for the explanation. In that case, it's working as designed :)
astraetech commentedon Aug 24, 2022
Hi,
Is there any tutorial for this? I spent 5 minutes shift-clicking on headers and still not getting a double sort on two columns: 1 Character (ascending) 2. Numeric. (ascending)
Thank you
ronblum commentedon Aug 25, 2022
@astraetech What version of RStudio, R, and operating system are you using? I just tried it in RStudio Desktop RStudio-2022.07.1+554 and RStudio-2022.11.0-daily+135 on MacOS 13 as a starting point, and I'm able to get multiple column selection with Shift-Click.