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

Description Usage Arguments Value Examples

View source: R/RowFactor.R

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
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)

Arguments

x

A variable to be treated as a factor.

name

The display name for the factor.

levelnames

The strings to use as levels of x.

texify

If TRUE, characters that would be interpreted specially by LaTeX are escaped (using latexTranslate) so they will print properly.

expr

The expression to use in evaluating the factor. Generally the same as the expression passed as x, but internal uses may differ.

override

Should the name for the factor override any previously specified Heading() setting?

spacing

Extra spacing will be added before every spacing lines.

space

How much extra space to add, in ex units.

suppressfirst

Whether to suppress the spacing in the first group.

nopagebreak

LaTeX macro to insert to suppress page breaks except between groups.

width

How many columns should the label span?

first

Which is the first column in which this label appears?

justify

How should the label be justified in the columns?

Value

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

Examples

1
2
3
4
tabular( Factor(1:10, "row") ~
       All(iris[1:10,])*Heading()*identity )
toLatex( tabular( RowFactor(1:10, "", 5)  ~ 
       All(iris[1:10,])*Heading()*identity )) 

tables documentation built on Oct. 23, 2020, 5:21 p.m.