p1 +(p2+ scale_y_continuous( position = "right"))
#> Scale for y is already present.
#> Adding another scale for y, which will replace the existing scale.
#> Error in FUN(X[[i]], ...): subscript out of bounds
egg::ggarrange(p1 ,(p2+ scale_y_continuous( position = "right"))
, ncol =2)
#> Scale for y is already present.
#> Adding another scale for y, which will replace the existing scale.
workaround is to use egg ggarrange
Created on 2023-11-30 with reprex v2.0.2