CatTable: Function to write a table

Description Usage Arguments Author(s) See Also Examples

View source: R/DescTools.r

Description

CatTable helps printing a table, if is has to be broken into multiple rows. Rowlabels will be repeated after every new break.

Usage

1
CatTable(tab, wcol, nrepchars, width = getOption("width"))

Arguments

tab

the rows of a table to be printed, pasted together in one string with constant columnwidth.

wcol

integer, the width of the columns. All columns must have the same width.

nrepchars

integer, the number of characters to be repeated with every break. This is typically the maximum width of the rowlabels.

width

integer, the width of the whole table. Default is the width of the current command window (getOption("width")).

Author(s)

Andri Signorell <andri@signorell.net>

See Also

table, paste

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
options(scipen=8)

# used in bivariate description functions
Desc(temperature ~ cut(delivery_min, breaks=40), data=d.pizza)


txt <- c( 
   paste(sample(letters, 500, replace=TRUE), collapse="")
 , paste(sample(letters, 500, replace=TRUE), collapse="")
 , paste(sample(letters, 500, replace=TRUE), collapse="")
)
txt <- paste(c("aaa","bbb","ccc"), txt, sep="")

CatTable(txt, nrepchars=3, wcol=5)

AndriSignorell/DescTools documentation built on April 8, 2021, 5:51 a.m.