TITLE(abbreviate @@ Abbreviate Strings)
USAGE(
abbreviate(names.arg, minlength=4, use.classes=TRUE,
        dot=FALSE)
)
ALIAS(abbreviate)
ARGUMENTS(
ARG(names.arg @@ a vector of names to be abbreviated.)
ARG(minlength @@ the minimum length of the abbreviations.)
ARG(use.classes @@ a flag which is ignored by R.)
ARG(dot @@ a flag indicating whether to postpend a dot.)
)
VALUE(
A character vector containing abbreviations for the strings
in its first argument.
Duplicates in the original LANG(names.arg) will be given identical
abbreviations. If any non-duplicated elements have the same
LANG(minlength) abbreviations then LANG(minlength) is incremented
by one and new abbreviations are found for those elements only.
This process is repeated until all unique elements of LANG(names.arg)
have unique abbreviations.
PARA
The character version of LANG(names.arg) is attached to the returned value
as a names argument.
PARA
The algorithm used is similar to that of S.
First spaces at the beginning of the word are stripped.
Then any other spaces are stripped.
Next lower case vowels are removed followed by lower case consonants.
Finally if the abbreviation is still longer than LANG(minlength)
upper case letters are stripped.
Letters are always stripped from the end of the word first.
If an element of LANG(names.arg) contains more than one word
(words are separted by space) then at least one letter from
each word will be retained.
If a single string is passed it is abbreviated in the same manner as a
vector of strings.
PARA
If LANG(use.classes) is LANG(FALSE) then the only distinction is to be between
letters and space. This has NOT been implemented.
)
SEEALSO(
LANG(LINK(substr)).
)
EXAMPLES(
x <- c("abcd","efgh","abce")
abbreviate(x,2)
)
