Pass in a named list of gg objects and apply pm_relabel().

relabel_at(x, at = names(x), spec = list(), labs = list(), re = NULL, ...)

Arguments

x

a named list of gg objects.

at

a character vector of list names to relabel.

spec

a named list of label data; names correspond to columns in the data used to make the plots; may also be a yspec object.

labs

another object like spec containing of label data to override names found in spec.

re

a regular expression for selecting names to be used for at.

...

additional arguments passed to pm_relabel().

Details

Note that all plots in the list need to be named. When re is provided it takes precedence over at.

See also

Examples

data <- pmplots_data_obs()

spec <- list(DV = "Observed (ng/mL)", PRED = "Population predicted (ng/mL)")

x <- list(p1 = dv_pred(data), p2 = dv_ipred(data))

x <- relabel_at(x, at = "p1", spec = spec)
x$p1
#> `geom_smooth()` using formula = 'y ~ x'


x <- relabel_at(x, re = "p", spec = spec)
x$p2
#> `geom_smooth()` using formula = 'y ~ x'
#> `geom_smooth()` using formula = 'y ~ x'