formatDL                package:base                R Documentation

_F_o_r_m_a_t _D_e_s_c_r_i_p_t_i_o_n _L_i_s_t_s

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

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

     formatDL(x, y, style = c("table", "list"),
              width = 0.9 * getOption("width"), indent = NULL)

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

       x: a vector giving the items to be described.  Will be coerced
          to a character vector.

       y: a vector of the same length as `x' with the corresponding
          descriptions.  Will be coerced to a character vector.

   style: a character string specifying the rendering style of the
          description information.  If `"table"', a two-column table
          with items and descriptions as columns is produced (similar
          to Texinfo's `@table' environment.  If `"list"', a
          LaTeX-style tagged description list is obtained.

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

  indent: a positive integer specifying the indentation of the second
          column in table style, and the indentation of continuation
          lines in list style.  Must not be greater than `width/2', and
          defaults to `width/3' for table style and `width/9' for list
          style.

_D_e_t_a_i_l_s:

     In table style, items with more than `indent - 3' characters are
     displayed on a line of their own.

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

     a character vector with the formatted entries.

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

     ## Use R to create the `INDEX' for package `eda' from its `CONTENTS'
     x <- read.dcf(file = system.file("CONTENTS", package = "eda"),
                    fields = c("Entry", "Description"))
     x <- as.data.frame(x)
     writeLines(formatDL(x$Entry, x$Description))
     ## Same information in tagged description list style:
     writeLines(formatDL(x$Entry, x$Description, style = "list"))

