home *** CD-ROM | disk | FTP | other *** search
/ Big Green CD 8 / BGCD_8_Dev.iso / NEXTSTEP / UNIX / Educational / R-0.49-MI / R-0.49-I / help / base / abbreviate next >
Encoding:
Text File  |  1997-04-23  |  1.9 KB  |  57 lines

  1.     
  2.     _A_b_b_r_e_v_i_a_t_e _S_t_r_i_n_g_s
  3.     
  4.          abbreviate(names.arg, minlength=4, use.classes=TRUE,
  5.                  dot=FALSE)
  6.     
  7.     _A_r_g_u_m_e_n_t_s:
  8.     
  9.        names.arg : a vector of names to be abbreviated.
  10.     
  11.        minlength : the minimum length of the abbreviations.
  12.     
  13.      use.classes : a flag which is ignored by R.
  14.     
  15.              dot : a flag indicating whether to postpend a dot.
  16.     
  17.     _V_a_l_u_e:
  18.     
  19.          A character vector containing abbreviations for the
  20.          strings in its first argument.  Duplicates in the ori-
  21.          ginal names.arg will be given identical abbreviations.
  22.          If any non-duplicated elements have the same minlength
  23.          abbreviations then minlength is incremented by one and
  24.          new abbreviations are found for those elements only.
  25.          This process is repeated until all unique elements of
  26.          names.arg have unique abbreviations.
  27.     
  28.          The character version of names.arg is attached to the
  29.          returned value as a names argument.
  30.     
  31.          The algorithm used is similar to that of S.  First
  32.          spaces at the beginning of the word are stripped.  Then
  33.          any other spaces are stripped.  Next lower case vowels
  34.          are removed followed by lower case consonants.  Finally
  35.          if the abbreviation is still longer than minlength
  36.          upper case letters are stripped.  Letters are always
  37.          stripped from the end of the word first.  If an element
  38.          of names.arg contains more than one word (words are
  39.          separted by space) then at least one letter from each
  40.          word will be retained.  If a single string is passed it
  41.          is abbreviated in the same manner as a vector of
  42.          strings.
  43.     
  44.          If use.classes is FALSE then the only distinction is to
  45.          be between letters and space. This has NOT been imple-
  46.          mented.
  47.     
  48.     _S_e_e _A_l_s_o:
  49.     
  50.          substr.
  51.     
  52.     _E_x_a_m_p_l_e_s:
  53.     
  54.          x <- c("abcd","efgh","abce")
  55.          abbreviate(x,2)
  56.     
  57.