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

Package tests fail with ggplot2 3.5.0 #5612

Closed
vnijs opened this issue Dec 23, 2023 · 5 comments
Closed

Package tests fail with ggplot2 3.5.0 #5612

vnijs opened this issue Dec 23, 2023 · 5 comments

Comments

@vnijs
Copy link

vnijs commented Dec 23, 2023

I was getting errors testing several of my packages with devtools::check_win_dev(). See example message below.

 > clt("Uniform", 100, 100, unif_min = 10, unif_max = 20) %>% plot()
  Error in Ops.data.frame(guide_loc, panel_loc) : 
    ‘==’ only defined for equally-sized data frames
  Calls: <Anonymous> ... plot_table.ggplot -> add_guides -> unlist -> Ops.data.frame
  Execution halted

I tracked it down to the example below. This works fine with the previous version of ggplot2 and the current version of patchwork. However, with the development version of ggplot2 I'm seeing the same error as above. Not clear exactly where this is coming from but it seems to be a breaking change ggplot2 since I'm using the same version of patchwork. If this should be posted to patchwork, please let me know.

remotes::install_github("tidyverse/ggplot2")
library(ggplot2)
library(patchwork)
plot_list <- list()
plot_list[[1]] <- ggplot(mtcars, aes(x = mpg)) + geom_histogram(binwidth = 1)
wrap_plots(plot_list, ncol = 1)
#> Error in Ops.data.frame(guide_loc, panel_loc): '==' only defined for equally-sized data frames

Created on 2023-12-22 with reprex v2.0.2

@teunbrand
Copy link
Collaborator

teunbrand commented Dec 23, 2023

Thanks for the report! This particular problem already has an issue in patchwork, see thomasp85/patchwork#342. It also has a PR that would fix the behaviour: thomasp85/patchwork#339. To test your package against the current release candidate and patchwork with that PR, you can use:

remotes::install_github("thomasp85/patchwork", ref = remotes::github_pull("339"))
remotes::install_github("tidyverse/ggplot2", ref = remotes::github_pull("5592"))

We're currently working through reverse dependency checks to avoid unecessarily breaking packages, but there are probably some that'd need updates. If you find something unbecoming, like bugs, please let us know.

I'll leave this issue open for now so that other developers might stumble upon it.

EDIT: The mentioned PR is now merged, so now you can do:

remotes::install_github("thomasp85/patchwork")
remotes::install_github("tidyverse/ggplot2", ref = remotes::github_pull("5592"))

@vnijs
Copy link
Author

vnijs commented Dec 23, 2023

Thanks @teunbrand. I can confirm that pr you mentioned fixes the issue I was seeing.

remotes::install_github("thomasp85/patchwork", ref = remotes::github_pull("339"))

@aphalo
Copy link
Contributor

aphalo commented Jan 2, 2024

@teunbrand Indeed, I can confrim that the error I reported in #5619 is resolved by installing 'patchwork' pull 339 as mentioned above.

@teunbrand
Copy link
Collaborator

I'm closing this now, as the patched patchwork was landed on CRAN and this should not be an issue any longer.

@z-bluesky
Copy link

I had the following problem when running the vlnplot and dimplot functions in the Seurat package:
VlnPlot(scRNAlist[[i]], features = c("nFeature_RNA"))
Error in Ops.data.frame(guide_loc, panel_loc) :
‘==’ only defined for equally-sized data frames
But I use this line of code, restart the session and it works, finally! Thank you guys!!!
remotes::install_github("thomasp85/patchwork")

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

No branches or pull requests

4 participants