This function adds candidate axis titles as an attribute on columns in
data. This attribute is intended to be specifically used for pmplot axis
labels, not to be confused with the label added by yspec::ys_add_labels().
Usage
pm_label_columns(df, spec, labs = list(), short_max = Inf)Arguments
- df
a data frame to label.
- spec
a named list of label data; names correspond to columns in the data used to make the plot; may also be a
yspecobject, which will be converted to a named list throughyspec::ys_get_short_unit().- labs
another object like
speccontaining of label data to override names found inspec.- short_max
passed to
yspec::ys_get_short_unit()whenspecis ayspecobject.
Value
The data frame df with pmp.axis.label attributes set on the
labeled columns. If no columns in spec or labs match column names in
df, a warning is issued and df is returned unchanged.
