textTable {tablesgg} | R Documentation |
Create a Structure Representing a 2D Table
Description
Create a structure representing the content and organization of a 2D table: table body, row and column headers, and annotation. All table cells are formatted as character strings. This is an S3 generic.
Usage
textTable(x, ...)
Arguments
x |
Object to be formatted as a 2D table. |
... |
Additional arguments passed to specific methods. |
Details
textTable
objects are the fundamental structure used to represent
table _content_ and _organization_ in the tablesgg
package.
Components body
, rowhead
, rowheadLabels
,
colhead
, title
, subtitle
, and foot
correspond
to the table _parts_ with those names. Empty parts should be of type
character: either a 0-length vector or a matrix with one or both
dimensions equal to 0, depending on the component.
Character strings representing table content may be prefixed with either
"MATH_" or "MKDN_". The former indicates the string is to be interpreted
as a plotmath
expression, the latter that the string contains
markdown or HTML tags.
Components partdim
, rowhier
, and colhier
are
automatically derived from the other components whenever a
textTable
is created or updated.
See Appendix A of the package vignette for more information about writing
textTable
methods.
Value
An object with S3 class textTable
. This is a list with components:
body |
Character matrix containing the body of the table. |
rowhead |
Character matrix with the same number of rows as the table body, containing row headers for the table. Row headers are displayed as a set of columns to the left of the table body. May be empty (0 columns). |
rowheadLabels |
Character matrix with as many columns as |
colhead |
Character matrix with the same number of columns as the table body,
containing column headers for the table. Column headers are displayed as
a set of rows above the table body. If |
title , subtitle , foot |
Character vectors providing annotation for the table. May be empty (length 0). |
partdim |
Numeric matrix with one row per table part (i.e., the components listed above), and columns:
|
rowhier , colhier |
Lists describing the hierarchical structure of row and column headers,
respectively. Each list has one component per header layer (column of
|
Components body
, rowhead
, and colhead
will each have
an attribute type
. For body
this will be a character matrix
with the same dimensions, containing an arbitrary string describing the
type of value represented in each cell (e.g., "numeric"), or NA. For
rowhead
and colhead
, it will be a character vector with
length equal to the number of layers of headers (i.e., number of columns
in rowhead
, number of rows in colhead
), again containing a
string describing the type of values in each layer, or NA.
Components body
, rowhead
, rowheadLabels
,
colhead
, title
, subtitle
, and foot
will each
have an attribute justification
. It will be a character matrix or
vector of the same size and shape as the component. Values "l", "c", "r"
specify left, centered, and right horizontal justification of text,
respectively, for the corresponding table entry. Value NA means that the
type of justification is not specified–it will be set by the entry style
used when plotting the table.
See Also
Specific methods for creating textTable's from other objects.