This function relabels the axis strip labels in a pairs plot created by
eta_pairs() or pairs_plot() by looking up the variable names in a named
list or yspec object. Variable names are discovered automatically from the
plot object. Names absent from spec and labs are left unchanged.
pmp_relabel_pairs(
p,
spec,
labs = list(),
short_max = Inf,
f_break = Inf,
unit_break = TRUE,
...
)a pairs plot object created by eta_pairs() or pairs_plot().
a named list of label data; names correspond to columns
in the data used to make the plot; may also be a yspec object, which
will be converted to a named list through yspec::ys_get_short_unit().
another object like spec containing of label data to override
names found in spec.
passed to yspec::ys_get_short_unit() when spec is a
yspec object.
character width at which to insert a single line break in
facet strip labels; defaults to Inf (no break); when the resolved label
exceeds this width, a single newline is inserted at the last word boundary
at or before the limit.
if TRUE (the default), a newline is inserted between the
label text and a trailing parenthetical unit (e.g., "Weight (kg)" becomes
"Weight\n(kg)").
currently not used.
The pairs plot p with updated facet labels.
id <- pmplots_data_id()
etas <- c("ETA1//ETA-CL", "ETA2//ETA-VC", "ETA3//ETA-KA")
spec <- list(ETA1 = "ETA on CL (L/h)", ETA2 = "ETA on Vc (L)")
p <- eta_pairs(id, etas)
pmp_relabel_pairs(p, spec)
#> `geom_smooth()` using formula = 'y ~ x'
#> `geom_smooth()` using formula = 'y ~ x'
#> `geom_smooth()` using formula = 'y ~ x'