shorten: Shorten long names

Description Usage Arguments Value Author(s) See Also Examples

Description

Removes common prefixes and suffixes from character vectors.

Usage

1
  Shorten(words)

Arguments

words

A character vector to be shortened.

Value

The argument words is returned, after common prefixes and suffixes have been removed. If all arguments are identical then no shortening is done.

Author(s)

Steven L. Scott stevescott@google.com

See Also

bsts.mixed.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
  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"


Search within the bsts package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.