formatDL {base} | R Documentation |
Format Description Lists
Description
Format vectors of items and their descriptions as 2-column tables or LaTeX-style description lists.
Usage
formatDL(x, y, style = c("table", "list"),
width = 0.9 * getOption("width"), indent = NULL)
Arguments
x |
a vector giving the items to be described, or a list of length 2 or a matrix with 2 columns giving both items and descriptions. |
y |
a vector of the same length as |
style |
a character string specifying the rendering style of the
description information. Can be abbreviated.
If |
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 |
Details
After extracting the vectors of items and corresponding descriptions from the arguments, both are coerced to character vectors.
In table style, items with more than indent - 3
characters are
displayed on a line of their own.
Value
a character vector with the formatted entries.
Examples
## Provide a nice summary of the numerical characteristics of the
## machine R is running on:
writeLines(formatDL(unlist(.Machine)))
## Inspect Sys.getenv() results in "list" style (by default, these are
## printed in "table" style):
writeLines(formatDL(Sys.getenv(), style = "list"))