Skip to content

Package tests fail with ggplot2 3.5.0 #5612

@vnijs

Description

@vnijs

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions