Skip to content

Error using patchwork #454

Description

@srk7774

Please look into this

library(ggplot2)
library(patchwork)
#> Warning: package 'patchwork' was built under R version 4.4.3
#> Error: package or namespace load failed for 'patchwork':
#>  object 'is_ggplot' is not exported by 'namespace:ggplot2'

p1 <- ggplot(mtcars) + geom_point(aes(mpg, disp))
p2 <- ggplot(mtcars) + geom_boxplot(aes(gear, disp, group = gear))

p1 + p2
#> Error in `ggplot_add()`:
#> ! Can't add `p2` to a <ggplot> object.

Created on 2025-10-22 with reprex v2.1.1

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions