shortenstring: Shorten Strings

shortenstringR Documentation

Shorten Strings

Description

Strings are shortened if they are longer than n

Usage

shortenstring(x, n = 50, endstring = "..", endchars = NULL)

Arguments

x

a string or a vector of strings

n

maximal character length

endstring

string(s) to be appended to the shortened strings

endchars

number of last characters to be shown at the end of the abbreviated string. By default, it adjusts to n.

Value

Abbreviated string(s)

Author(s)

Werner A. Stahel

See Also

substring, abbreviate

Examples

shortenstring("abcdefghiklmnop", 8)

shortenstring(c("aaaaaaaaaaaaaaaaaaaaaa","bbbbc",
  "This text is certainly too long, don't you think?"),c(8,3,20))


relevance documentation built on May 1, 2023, 5:20 p.m.