shorten | R Documentation |
Removes common prefixes and suffixes from character vectors.
Shorten(words)
words |
A character vector to be shortened. |
The argument words
is returned, after common prefixes and
suffixes have been removed. If all arguments are identical then no
shortening is done.
Steven L. Scott steve.the.bayesian@gmail.com
bsts.mixed
.
Shorten(c("/usr/common/foo.tex", "/usr/common/barbarian.tex"))
# returns c("foo", "barbarian")
Shorten(c("hello", "hellobye"))
# returns c("", "bye")
Shorten(c("hello", "hello"))
# returns c("hello", "hello")
Shorten(c("", "x", "xx"))
# returns c("", "x", "xx")
Shorten("abcde")
# returns "abcde"
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.