powered by
Strings are shortened if they are longer than n
n
shortenstring(x, n = 50, endstring = "..", endchars = NULL)
Abbreviated string(s)
a string or a vector of strings
maximal character length
string(s) to be appended to the shortened strings
number of last characters to be shown at the end of the abbreviated string. By default, it adjusts to n.
Werner A. Stahel
substring, abbreviate
substring
abbreviate
shortenstring("abcdefghiklmnop", 8) shortenstring(c("aaaaaaaaaaaaaaaaaaaaaa","bbbbc", "This text is certainly too long, don't you think?"),c(8,3,20))
Run the code above in your browser using DataLab