home *** CD-ROM | disk | FTP | other *** search
-
- _A_b_b_r_e_v_i_a_t_e _S_t_r_i_n_g_s
-
- abbreviate(names.arg, minlength=4, use.classes=TRUE,
- dot=FALSE)
-
- _A_r_g_u_m_e_n_t_s:
-
- names.arg : a vector of names to be abbreviated.
-
- minlength : the minimum length of the abbreviations.
-
- use.classes : a flag which is ignored by R.
-
- dot : a flag indicating whether to postpend a dot.
-
- _V_a_l_u_e:
-
- A character vector containing abbreviations for the
- strings in its first argument. Duplicates in the ori-
- ginal names.arg will be given identical abbreviations.
- If any non-duplicated elements have the same minlength
- abbreviations then minlength is incremented by one and
- new abbreviations are found for those elements only.
- This process is repeated until all unique elements of
- names.arg have unique abbreviations.
-
- The character version of names.arg is attached to the
- returned value as a names argument.
-
- 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 minlength
- upper case letters are stripped. Letters are always
- stripped from the end of the word first. If an element
- of 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.
-
- If use.classes is FALSE then the only distinction is to
- be between letters and space. This has NOT been imple-
- mented.
-
- _S_e_e _A_l_s_o:
-
- substr.
-
- _E_x_a_m_p_l_e_s:
-
- x <- c("abcd","efgh","abce")
- abbreviate(x,2)
-
-