Description Usage Arguments Details Value Examples
View source: R/helper_functions.R
The function will insert new lines symbol (\n)
replacing "_", ".",
and before "(", so that long labels can be displayed on multiple lines
1 | normalize_axes_labels(s, revert = FALSE)
|
s |
vector of labels to be normalized |
revert |
if FALSE, the symbols _,.,( are replaced with new lines. If TRUE, the operation is reverted; see "Details" |
Literally undoing the normalization is obviously not possible, since there is no way of knowing which symbols were replaced with nelines. Thus, the newlines not adjacent to "(" are replaced with "_"; the newlines preceding "(" are just deleted.
vector of normalized labels if revert = FALSE
; vector of labels
without newlines if revert = TRUE
1 2 3 | labels <- c("critical_region", "spillover.region", "region(another)")
normalize_axes_labels(labels)
# [1] "critical\nregion" "spillover\nregion" "region\n(another)"
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.