abbr | R Documentation |
Extract abbreviations from strings.
abbr(x, pattern = "[A-Z]", n = 1L, include = "[a-z]+")
x |
a vector of strings to abbreviate |
pattern , n |
the pattern and number of occurrences to use |
include |
an optional pattern to match additional strings surrounded by word boundaries; any non character will omit |
x <- c('United States of America', 'the Red, the White, and the Blue')
abbr(x)
abbr(x, include = NA)
abbr(x, include = 'and')
abbr(x, '[A-Z][A-z]', include = NA)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.