labeller
|
how the labels should be relabelled or reformatted. One of:
-
a function to be applied to x, e.g. format, toupper, abs, or any other custom function (including from the popular scales package).
-
one of the following convenience strings (or their symbol equivalents), for which common formatting transformations are provided: “percent” (“%”), “comma” (“,”), “log” (“l”), “dollar” (“$”), “euro” (“€”), or “sterling” (“£”).
-
a dictionary, i.e. a named character vector or list of form c(old_lab = “new_lab”, …). Entries of x that match a name are replaced by the corresponding value and the rest are left alone, so a partial mapping is fine. The lookup is by value rather than by position, which means it is unaffected by any reordering of the underlying categories.
Note that an unnamed character vector of length greater than one is an error, rather than a positional replacement of the labels. Such a vector cannot be distinguished from a formatting keyword when x is of length one, and would not follow the categories if they were reordered. Pass a function if you want to compute the labels positionally, e.g. function(x) LETTERS[seq_along(x)].
|