I am using RStudio Version 1.2.1335. Occationally, I view my data.frame in the source pane and to filter and sort the data. However, the sorting functionality does not seem to work. The order the rows change, but are not in the right order afterwards.
Best wishes, Silke
Hi,
In order for us to help you with your question, please provide us a minimal reprocudible example where you provide a minimal (dummy) dataset and code that can recreate the issue. One we have that, we can go from there. For help on creating a Reprex, see this guide:
A minimal reproducible example consists of the following items:
A minimal dataset, necessary to reproduce the issue
The minimal runnable code necessary to reproduce the issue, which can be run
on the given dataset, and including the necessary information on the used packages.
Let's quickly go over each one of these with examples:
Minimal Dataset (Sample Data)
You need to provide a data frame that is small enough to be (reasonably) pasted on a post, but big enough to reproduce your issue.
Let's say, as an example, that you are working with the iris data frame
head(iris)
#> Sepal.Length Sepal.Width Petal.Length Petal.Width Species
#> 1 5.1 3.5 1.4 0.โฆ
Good luck!
PJ
Here is my example.
In my RStudio, I only see 50 columns at once. The problem does not occur if I want to sort one of the first 50 columns. But after switching to the end of the data view (using >>) ordering and filtering does not work anymore. It seems to be a bug in the RStudio IDE.
mtcars2 <- cbind(mtcars,mtcars,mtcars,mtcars,mtcars)
With mtcars2 I can reproduce the problem.
Silke
It just so happens that I had exactly the same dataframe in my environment while answering another question, but I can't reproduce your problem. One difference I have is that I've renamed the columns to have unique names with tibble(.name_repair = "unique")
. Can you try doing the same and see if it helps?
sjtaff
August 22, 2019, 4:48pm
5
I see exactly the same issue with any dataset with more than 50 columns. When I click the double right arrow in RStudio View to see columns 51-onward, none of the newly-revealed columns respond properly to the sort up/sort down arrows. The rows move around, but they don't end up in proper sort order.
RStudio Version 1.2.1335: using tibble(df,.name_repair="unique") has no effect.
Looking in it a little more, I can see that its indeed broken.
You are more likely to get attention from the RStudio developers by filing an issue on the github repository
Just make sure to follow this guide about how to write good bug reports:
2 Likes
I believe this is same as this issue, which is already marked as a confirmed bug:
opened 02:37PM - 22 Apr 19 UTC
closed 11:58PM - 04 Feb 20 UTC
bug
reproducible
data viewer
<!--
RStudio v1.2 is now available for download at https://www.rstudio.com/prโฆ oducts/rstudio/download/. If you're currently using an older version of RStudio, we would appreciate it if you could update to RStudio v1.2 and confirm whether the problem still persists.
This issue tracker is for bugs and feature requests in the RStudio IDE. If you're having trouble with R itself or an R package, see https://www.r-project.org/help.html, and if you want to ask a question rather than report a bug, go to https://community.rstudio.com/. Finally, if you use RStudio Server Pro, get in touch with our Pro support team at support@rstudio.com.
See our guide to writing good bug reports for more details: https://github.com/rstudio/rstudio/wiki/Writing-Good-Bug-Reports
-->
### 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.
2. 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.
<img width="1312" alt="example" src="https://user-images.githubusercontent.com/6429302/56505701-a1d39b00-651c-11e9-9cd2-11e2273e373e.png">
### 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)
```
<!-- Depending on the problem, the following may also be helpful
1. The output of sessionInfo()
2. The R code in question
3. A diagnostics report; see https://support.rstudio.com/hc/en-us/articles/200321257-Running-a-Diagnostics-Report
Thank you for taking the time to file an issue! -->
3 Likes
sjtaff
August 22, 2019, 6:16pm
9
You are correct. My issue is the same as the already reported bug. Thanks.
system
Closed
September 12, 2019, 6:16pm
10
This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.