View source: R/utils-validation.R
| abbrev_label | R Documentation |
Abbreviates labels to a maximum length, adding ellipsis if truncated.
abbrev_label(label, abbrev = NULL, n_labels = NULL)
label_abbrev(label, abbrev = NULL, n_labels = NULL)
label |
Character vector of labels to abbreviate. |
abbrev |
Abbreviation control:
|
n_labels |
Number of labels (used for "auto" mode). If NULL, uses length(label). |
Character vector of (possibly abbreviated) labels.
labels <- c("VeryLongStateName", "Short", "AnotherLongName")
# No abbreviation
abbrev_label(labels, NULL)
# Fixed max length
abbrev_label(labels, 5) # "Very...", "Short", "Anot..."
# Auto-adaptive
abbrev_label(labels, "auto")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.