format                 package:utils                 R Documentation

_F_o_r_m_a_t _U_n_o_r_d_e_r_e_d _a_n_d _O_r_d_e_r_e_d _L_i_s_t_s

_D_e_s_c_r_i_p_t_i_o_n:

     Format unordered (itemize) and ordered (enumerate) lists.

_U_s_a_g_e:

     formatUL(x, label = "*", offset = 0,
              width = 0.9 * getOption("width"))
     formatOL(x, type = "arabic", offset = 0, start = 1,
              width = 0.9 * getOption("width"))

_A_r_g_u_m_e_n_t_s:

       x: a character vector of list items.

   label: a character string used for labelling the items.

  offset: a non-negative integer giving the offset (indentation) of the
          list.

   width: a positive integer giving the target column for wrapping
          lines in the output.

    type: a character string specifying the 'type' of the labels in the
          ordered list.  If '"arabic"' (default), arabic numerals are
          used.  For '"Alph"' or '"alph"', single upper or lower case
          letters are employed (in this case, the number of the last
          item must not exceed 26.  Finally, for '"Roman"' or
          '"roman"', the labels are given as upper or lower case roman
          numerals (with the number of the last item maximally 3899).
          'type' can be given as a unique abbreviation of the above, or
          as one of the HTML style tokens '"1"' (arabic), '"A"'/'"a"'
          (alphabetic), or '"I"'/'"i"' (roman), respectively.

   start: a positive integer specifying the starting number of the
          first item in an ordered list.

_V_a_l_u_e:

     A character vector with the formatted entries.

_S_e_e _A_l_s_o:

     'formatDL' for formatting description lists.

_E_x_a_m_p_l_e_s:

     ## A simpler recipe.
     x <- c("Mix dry ingredients thoroughly.",
            "Pour in wet ingredients.",
            "Mix for 10 minutes.",
            "Bake for one hour at 300 degrees.")
     ## Format and output as an unordered list.
     writeLines(formatUL(x))
     ## Format and output as an ordered list.
     writeLines(formatOL(x))
     ## Ordered list using lower case roman numerals.
     writeLines(formatOL(x, type = "i"))
     ## Ordered list using upper case letters and some offset.
     writeLines(formatOL(x, type = "A", offset = 5))

