textTable.xtableList: Create a 'texttable' from an 'xtablelist' Object

Description Usage Arguments Details Value Examples

View source: R/textTable_methods2.bare.R

Description

Create a textTable from an xtableList object produced by the xtable package. Such an object represents a set of subtables that are to be stacked into a single table, with "subheadings" separating the subtables. The textTable that is produced by this function uses the subheadings as an additional, outer row header layer. That layer can optionally be moved inside the table by setting rowheadInside=TRUE when the table is plotted.

Usage

1
2
## S3 method for class 'xtableList'
textTable(x, title, subtitle=character(0), foot, ...)

Arguments

x

An xtableList object as produced by the xtable package. All the subtables in x must have the same column names.

title

Optional character vector containing title lines for the table. May be empty (character(0)). The default is to use the first element of the caption attribute of x, if present.

subtitle, foot

Optional character vectors providing additional annotation for the table. May be empty (i.e., character(0)). The default for foot is the message attribute of x.

...

Additional arguments passed to textTable.xtable for each of the subtables in x. See the documentation for that function.

Details

This function was designed based on the structure of objects produced by version 1.8-4 of the xtable package.

If x has a message attribute, it is used as the default value of the foot component of the returned textTable.

If components of x have no subheading attribute, then the subtables are simply stacked, with no additional row header layer to separate or distinguish them. It is an error if only some of the components have a subheading attribute.

Value

An object with S3 class textTable. See the documentation for the generic for details about its structure.

Examples

1
2
3
4
5
6
7
# 'mtcars_xtab' is an 'xtableList', following an example in the 
# "listOfTablesGallery" vignette of the 'xtable' package.  (See '?mtcars_xtab'
# for the code to create it.)
plot(textTable(mtcars_xtab), rowheadInside=TRUE, 
     title="Example of plotting an 'xtableList'",
     subtitle="(With 'rowheadInside=TRUE')")
  

tablesgg documentation built on June 3, 2021, 1:06 a.m.