This is a wrapper function around rot_at(), rot_x(), and rot_y() that accepts gg objects, patchwork objects, or lists of gg or patchwork objects. Arguments to those wrapped functions can be passed through. See arguments to rot_at() as well as rot_x() and rot_y().

rot_xy(x, ...)

# S3 method for class 'gg'
rot_xy(x, axis = c("x", "y"), ...)

# S3 method for class 'patchwork'
rot_xy(x, axis = c("x", "y"), ...)

# S3 method for class 'list'
rot_xy(x, axis = c("x", "y"), ...)

Arguments

x

a gg object, patchwork object, or list of those objects.

...

arguments passed to rot_at() (at, re) or rot_x() / rot_y() (angle, vertical hjust, vjust).

axis

which axis to rotate (x or y).

See also

Examples

library(patchwork)

data <- pmplots_data_obs()

p <- dv_pred(data)

p1 <- rot_xy(p)
p2 <- rot_xy(p, vertical = TRUE)
p3 <- rot_xy(p, axis = "y", angle = 15)

p1 + p2 + p3
#> `geom_smooth()` using formula = 'y ~ x'
#> `geom_smooth()` using formula = 'y ~ x'
#> `geom_smooth()` using formula = 'y ~ x'


rot_xy(p + dv_ipred(data))
#> `geom_smooth()` using formula = 'y ~ x'
#> `geom_smooth()` using formula = 'y ~ x'
#> `geom_smooth()` using formula = 'y ~ x'


co <- c("STUDYc", "CPc")
etas <- paste0("ETA", 1:2)

x <- eta_covariate(data, x = co, y = etas, transpose = TRUE)

pp <- rot_xy(x, at = "CPc")

pm_with(pp, STUDYc/CPc)