Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong sorting in data viewer if columns in view don't start from the first #4682

Closed
stefanocoretta opened this issue Apr 22, 2019 · 5 comments · Fixed by #6151
Closed

Wrong sorting in data viewer if columns in view don't start from the first #4682

stefanocoretta opened this issue Apr 22, 2019 · 5 comments · Fixed by #6151

Comments

@stefanocoretta
Copy link

@stefanocoretta stefanocoretta commented Apr 22, 2019

System details

RStudio Edition : Desktop
RStudio Version : 1.2.1502
OS Version      : macOS 10.14.4 (18E226)
R Version       : 3.5.2 (2018-12-20)

Steps to reproduce the problem

  1. Read a dataframe with more than 50 columns.
  2. Visualise a range of columns that does not include the first colum.
  3. Sort in the data viewer any numeric column.

Describe the problem in detail

When trying to sort a column in the data viewer, and the columns in view do not start with the first column, the sorting is wrong.

example

Describe the behavior you expected

The expected behaviour should be correct sorting of the numeric values in the columns.

─ Session info ───────────────────────────────────────────────────────
 setting  value                       
 version  R version 3.5.2 (2018-12-20)
 os       macOS Mojave 10.14.4        
 system   x86_64, darwin15.6.0        
 ui       RStudio                     
 language (EN)                        
 collate  en_GB.UTF-8                 
 ctype    en_GB.UTF-8                 
 tz       Europe/Rome                 
 date     2019-04-22                  

─ Packages ───────────────────────────────────────────────────────────
 package           * version    date       lib source        
 assertthat          0.2.1      2019-03-21 [1] CRAN (R 3.5.2)
 backports           1.1.4      2019-04-10 [1] CRAN (R 3.5.2)
 callr               3.2.0      2019-03-15 [1] CRAN (R 3.5.2)
 cli                 1.1.0      2019-03-19 [1] CRAN (R 3.5.2)
 coretta2018itapol * 0.0.0.9000 2019-04-14 [1] local         
 crayon              1.3.4      2017-09-16 [1] CRAN (R 3.5.0)
 desc                1.2.0      2018-05-01 [1] CRAN (R 3.5.0)
 devtools            2.0.2      2019-04-08 [1] CRAN (R 3.5.2)
 digest              0.6.18     2018-10-10 [1] CRAN (R 3.5.0)
 fs                  1.2.7      2019-03-19 [1] CRAN (R 3.5.2)
 glue                1.3.1      2019-03-12 [1] CRAN (R 3.5.2)
 magrittr            1.5        2014-11-22 [1] CRAN (R 3.5.0)
 memoise             1.1.0      2017-04-21 [1] CRAN (R 3.5.0)
 packrat             0.5.0      2018-11-14 [1] CRAN (R 3.5.0)
 pkgbuild            1.0.3      2019-03-20 [1] CRAN (R 3.5.2)
 pkgload             1.0.2      2018-10-29 [1] CRAN (R 3.5.0)
 prettyunits         1.0.2      2015-07-13 [1] CRAN (R 3.5.0)
 processx            3.3.0      2019-03-10 [1] CRAN (R 3.5.2)
 ps                  1.3.0      2018-12-21 [1] CRAN (R 3.5.0)
 R6                  2.4.0      2019-02-14 [1] CRAN (R 3.5.2)
 Rcpp                1.0.1      2019-03-17 [1] CRAN (R 3.5.2)
 remotes             2.0.4      2019-04-10 [1] CRAN (R 3.5.2)
 rlang               0.3.4      2019-04-07 [1] CRAN (R 3.5.2)
 rprojroot           1.3-2      2018-01-03 [1] CRAN (R 3.5.0)
 rstudioapi          0.10       2019-03-19 [1] CRAN (R 3.5.2)
 sessioninfo         1.1.1      2018-11-05 [1] CRAN (R 3.5.0)
 testthat            2.0.1      2018-10-13 [1] CRAN (R 3.5.0)
 usethis             1.5.0      2019-04-07 [1] CRAN (R 3.5.2)
 withr               2.1.2      2018-03-15 [1] CRAN (R 3.5.0)

@willtudorevans
Copy link

@willtudorevans willtudorevans commented Jun 10, 2019

Filtering doesn't seem to work either.

@SimonDedman
Copy link

@SimonDedman SimonDedman commented Aug 20, 2019

The problem is that it's using relative referencing of column numbers from the end, but the end is hard coded to be <=50 so if you sort on:
column 50 of 50 ("last" = -0) it works
column 51 of 51, -0 should be 51 but it's 50.
I'm trying to sort on column 53 of 56, -3, sorting on 47.

@JLewyckyj
Copy link

@JLewyckyj JLewyckyj commented Jan 16, 2020

It seems kind of ridiculous that this doesn't work. What were you fixing by creating all this new functionality, that just so happens to ruin basic functionality that previously worked? Do you have any sense?

@rich-rstudio
Copy link
Contributor

@rich-rstudio rich-rstudio commented Mar 25, 2020

verified on Version 1.3.921

@m-macaskill
Copy link

@m-macaskill m-macaskill commented Jun 12, 2021

This bug is still present in RStudio version 1.4.1717.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants