formatDL(x, y, style = c("table", "list"), width = 0.9 * getOption("width"), indent = NULL)
x | one of the following.
|
y | a character vector containing the corresponding descriptions. Ignored if x is a list or a matrix. (If x is a vector with names and y is supplied, then the names in x are ignored, its values are used as the tags, and the values in y are used as the descriptions.) |
style | a character string specifying the format style. Must be "table" or "list". Partial matching is allowed. |
width | a small positive integer. Line breaks are inserted into the descriptions so that, if possible, when the descriptions are printed with cat(sep="\n", formatDL(..., width=width)) the printed lines are no longer than width characters. |
indent |
a non-negative integer. For the "table" style, this value specifies the indention of the
description lines: both the first and the continuation lines.
For the "list" style, this value specifies the indentation of continuation lines. (The first
line always starts right after the colon that follows the tag.)
indent must not be greater than width/2. The default value, NULL, specifies width/3 for the "table" style and width/9 for the "list" style. |
cat(sep="\n", formatDL(c(One="First number", Two="Second number", Three="Third number"))) # 3 more ways to make the same thing cat(sep="\n", formatDL(c("One", "Two", "Three"), c("First number", "Second number", "Third number"))) cat(sep="\n", formatDL(list(c("One", "Two", "Three"), c("First number", "Second number", "Third number")))) cat(sep="\n", formatDL(cbind(c("One", "Two", "Three"), c("First number", "Second number", "Third number")))) # 2 ways to reduce space between tags and descriptions cat(sep="\n", formatDL(c(One="First number", Two="Second number", Three="Third number"), indent=10)) cat(sep="\n", formatDL(c(One="First number", Two="Second number", Three="Third number"), width=24))# "list" style cat(sep="\n", formatDL(c(One="First number", Two="Second number", Third="Third number"), style="list"))
# line wrapping cat(sep="\n", formatDL(c(One="The most important concern", Two="A secondary concern", Miscellaneous="Matters of little interest to us"), width=35)) cat(sep="\n", formatDL(c(One="The most important concern", Two="A secondary concern", Miscellaneous="Matters of little interest to us"), width=35, style="list"))