lazy.matrix {lazyWeave} | R Documentation |
Convert Matrix to LaTeX Table
Description
An example of using lazyWeave
to produce tables
Usage
lazy.matrix(x, align = "center", justify = "center", rcol = NULL,
usecol = "lightgray", caption = NULL, footnote = NULL,
placement = "h", translate = TRUE, cat = getOption("lazyWeave_cat"),
...)
Arguments
x |
A matrix. Other objects are coerced to matrices |
align |
Character vector or string giving the alignment for each
column of the table. Options are |
justify |
Character string giving the alignment for the table on the
page. Options are |
rcol |
A vector giving the rows of |
usecol |
A character string or vector denoting the color of the rows
in |
caption |
Caption for the table. This is printed above the table |
footnote |
Additional footnotes for the table. These are printed below the table. |
placement |
Controls the placement of the figure. Options are
|
translate |
Toggles if inputs in |
cat |
Logical. Determines if the output is returned as a character string
or returned via the |
... |
Additional arguments to be passed to |
Details
The output for lazy.matrix
is highly inflexible compared
to lazy.table
. It is an example of how to build a reproducible
table with a certain formatting style that may be used again and again
for consistency.
Row names are always left justified. This cannot be changed.
placement
options are used as follows:
ht | Place the float here, i.e., approximately at the same point it occurs |
t | Position at the top of the page |
b | Position at the bottom of the page |
p | Put on a special page for floats only |
H | Places the float at precisely the location in the LaTeX code. Requires the float package |
The "!"
may be used after any of these in order to override
LaTeX float rules and force your selection. More can be learned by
reading about floats in a LaTeX manual
Author(s)
Benjamin Nutter
Examples
## Not run:
lazy.write(
lazy.file.start(),
lazy.text("The mtcars dataset describes a number of vehicles.
Let's take a look at the data"),
lazy.matrix(mtcars, rcol=(1:nrow(mtcars))[c(FALSE, TRUE)]),
lazy.file.end(),
OutFile="Example 1.tex")
unlink("Example 1.tex")
## End(Not run)