Create Abbreviations

abbrv(x, digits = TRUE)

Arguments

x

A character vector

digits

Include digits in the abbreviation

Value

Abbreviated versions of x

Examples

abbrv(c('HelloWorld', 'LetsGo3', 'tomato'))
#> [1] "hw"     "lg3"    "tomato"
abbrv(c('HelloWorld', 'LetsGo3', 'tomato'), digits = FALSE)
#> [1] "hw"     "lg"     "tomato"
abbrv('Wow3', digits = FALSE)
#> [1] "wow3"