Learn R Programming

tables (version 0.7.64)

RowFactor: Use a variable as a factor to give rows in a table.

Description

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.

Usage

Factor(x, name = deparse(expr), levelnames = levels(x), texify = TRUE, 
       expr = substitute(x), override = TRUE)
RowFactor(x, name = deparse(expr), 
	  levelnames = levels(x), 
          spacing = 3, space = 1, suppressfirst = TRUE,
          nopagebreak = "\\nopagebreak ",
          texify = TRUE, expr = substitute(x),
          override = TRUE)
Multicolumn(x, name = deparse(expr), levelnames = levels(x), 
            width=2, first=1, justify="l",
            texify = TRUE, expr = substitute(x),
            override = TRUE)

Arguments

Value

Language to insert into the table formula to achieve the desired table.

Examples

Run this code
tabular( Factor(1:10, "row") ~
       All(iris[1:10,])*Heading()*identity )
latex( tabular( RowFactor(1:10, "", 5)  ~ 
       All(iris[1:10,])*Heading()*identity ))

Run the code above in your browser using DataLab