The functions take a variable and treat it as a factor in a table.
RowFactor
is designed for LaTeX output, adding extra spacing to
make the table more readable. Multicolumn
also works only in
LaTeX, and displays the label in a style with the level on a line by
itself, spanning multiple columns.
Factor(x, name = deparse(expr), levelnames = levels(x),
texify = getOption("tables.texify", FALSE),
expr = substitute(x), override = TRUE)
RowFactor(x, name = deparse(expr),
levelnames = levels(x),
spacing = 3, space = 1, suppressfirst = TRUE,
nopagebreak = "\\nopagebreak ",
texify = getOption("tables.texify", FALSE),
expr = substitute(x),
override = TRUE)
Multicolumn(x, name = deparse(expr), levelnames = levels(x),
width=2, first=1, justify="l",
texify = getOption("tables.texify", FALSE),
expr = substitute(x),
override = TRUE)
Language to insert into the table formula to achieve the desired table.
A variable to be treated as a factor.
The display name for the factor.
The strings to use as levels of x
.
If TRUE
, characters that would be interpreted specially by LaTeX
are escaped (using latexTranslate
) so
they will print properly.
The expression to use in evaluating the factor. Generally the same
as the expression passed as x
, but internal uses
may differ.
Should the name for the factor override any previously specified
Heading()
setting?
Extra spacing will be added before every spacing
lines.
How much extra space to add, in ex
units.
Whether to suppress the spacing in the first group.
LaTeX macro to insert to suppress page breaks except between groups.
How many columns should the label span?
Which is the first column in which this label appears?
How should the label be justified in the columns?
tabular( Factor(1:10, "row") ~
All(iris[1:10,])*Heading()*identity )
toLatex( tabular( RowFactor(1:10, "", 5) ~
All(iris[1:10,])*Heading()*identity ))
Run the code above in your browser using DataLab