R: Function to write a table

CatTable {DescTools} | R Documentation

## Function to write a table

### Description

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

### Usage

    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

    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)

[Package DescTools version 0.99.35 Index]