strTrim | R Documentation |
trim a character vector to have a desired length by taking the beginning of the string and the end of the string
strTrim(
ss,
len.out = 50,
trim.str = "...",
len.pref = ceiling((len.out - nchar(trim.str))/2),
len.suf = len.out - len.pref - nchar(trim.str)
)
ss |
character vector |
len.out |
target output length to trim to |
trim.str |
string to place in between prefix and suffix |
len.pref |
length of the prefix to be used from the original string |
len.suf |
length of the suffix to be used from the original string |
character vector in which each element has length<=len.out
Fabian Mueller
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.