hms-dbmi / UpSetR

An R implementation of the UpSet set visualization technique published by Lex, Gehlenborg, et al..
https://cran.rstudio.com/web/packages/UpSetR
Other
753 stars 153 forks source link

Error in `check_breaks_labels()`: `upset()` now fails basic ggplot2 checks #235

Open smped opened 2 years ago

smped commented 2 years ago

I fear that this may be the end of UpSetR's compatibility with external packages. Plotting using fromList() no longer works and instead spits an error. Here's my Minimal Reprex

library(tidyverse)
library(UpSetR)
ex <- list(x = letters[1:10], y = letters[c(6:15, 26)],  z = letters[c(2, 10:25)])
df <- fromList(ex)
upset(df)
Error in `check_breaks_labels()`:
! `breaks` and `labels` must have the same length
Run `rlang::last_error()` to see where the error occurred.

Proceeding as advised

rlang::last_error()
<error/rlang_error>
Error in `check_breaks_labels()`:
! `breaks` and `labels` must have the same length
---
Backtrace:
 1. UpSetR::upset(df)
 2. UpSetR:::Make_matrix_plot(...)
 3. ggplot2::scale_y_continuous(...)
 4. ggplot2::continuous_scale(...)
 5. ggplot2:::check_breaks_labels(breaks, labels)
Run `rlang::last_trace()` to see the full context.

And the sessionInfo() output

sessionInfo()
R version 4.2.1 (2022-06-23)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 20.04.4 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.9.0
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.9.0

locale:
 [1] LC_CTYPE=en_AU.UTF-8       LC_NUMERIC=C               LC_TIME=en_AU.UTF-8        LC_COLLATE=en_AU.UTF-8     LC_MONETARY=en_AU.UTF-8    LC_MESSAGES=en_AU.UTF-8   
 [7] LC_PAPER=en_AU.UTF-8       LC_NAME=C                  LC_ADDRESS=C               LC_TELEPHONE=C             LC_MEASUREMENT=en_AU.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] UpSetR_1.4.0    forcats_0.5.1   stringr_1.4.0   dplyr_1.0.9     purrr_0.3.4     readr_2.1.2     tidyr_1.2.0     tibble_3.1.7    ggplot2_3.3.6   tidyverse_1.3.1

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.8.3     plyr_1.8.7       cellranger_1.1.0 pillar_1.7.0     compiler_4.2.1   dbplyr_2.1.1     tools_4.2.1      digest_0.6.29    jsonlite_1.8.0   lubridate_1.8.0 
[11] lifecycle_1.0.1  gtable_0.3.0     pkgconfig_2.0.3  rlang_1.0.2      reprex_2.0.1     rstudioapi_0.13  DBI_1.1.2        cli_3.3.0        haven_2.5.0      gridExtra_2.3   
[21] xml2_1.3.3       withr_2.5.0      httr_1.4.3       fs_1.5.2         generics_0.1.2   vctrs_0.4.1      hms_1.1.1        grid_4.2.1       tidyselect_1.1.2 glue_1.6.2      
[31] R6_2.5.1         fansi_1.0.3      readxl_1.4.0     farver_2.1.0     tzdb_0.3.0       modelr_0.1.8     magrittr_2.0.3   backports_1.4.1  scales_1.2.0     ellipsis_0.3.2  
[41] rvest_1.0.2      assertthat_0.2.1 colorspace_2.0-3 labeling_0.4.2   utf8_1.2.2       stringi_1.7.6    munsell_0.5.0    broom_0.8.0      crayon_1.5.1