StrAbbr | R Documentation |
Abbreviate a character vector. The function includes starting from the first character as many characters as there are needed to result in a vector of unique values.
StrAbbr(x, minchar = 1, method = c("left", "fix"))
x |
character vector to be abbreviated |
minchar |
integer, minimal number of characters for the abbreviations. |
method |
one out of |
The abbreviated strings.
Andri Signorell <andri@signorell.net>
abbreviate
, StrTrunc
, StrTrim
StrAbbr(x=levels(d.pizza$driver), minchar=2)
StrAbbr(x=levels(d.pizza$driver), minchar=2, method="left")
StrAbbr(x=levels(d.pizza$driver), minchar=2, method="fix")
x <- c("Aaron", "Aaramis", "Berta", "Bello", "Claudia", "Cardinale", "Doretta", "Emilia")
StrAbbr(x, minchar=2, method="left")
StrAbbr(x, minchar=2, method="fix")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.