View source: R/tblEntries.bare.R
tblEntries | R Documentation |
Assemble information about each entry in a table into a data frame with one row per entry, and columns for entry content and position in the table. This is an internal function, not intended to be called by package users.
tblEntries(x, mergeRuns=c(TRUE, TRUE), rowheadInside=FALSE)
x |
A |
mergeRuns |
Two-element logical vector, the first element applying to row headers, the
second to column headers. If TRUE (the default) then header cells that
contain runs of the same value will be merged into a single entry that
spans multiple rows or columns. Note that runs in the outermost row
header layer are always merged when |
rowheadInside |
Logical scalar. If TRUE, the outermost layer of row headers is moved inside the table by using its levels to divide the table into groups of rows, with each group labeled by their level. |
Entries include all parts of the table: the body of the table, row and
column headers, titles, subtitles, and foot lines. This function calls
textTable(x)
to convert table entries to character strings if
necessary.
If the text for an entry is missing (NA) the entry will be disabled, with a warning. If the text is an empty string (""), the entry will be disabled by default; this is so that blocks containing only empty cells will not have hvrules generated for them.
Row and column numbers used in creating default entry ID's are
partrow
and partcol
, and thus with respect to the dimensions
of the table part the entry belongs to, not the augmented row-column grid.
If an entry spans more than one row or column, the minimum row/column
number of the spanned cells is used.
The rowhier
and colhier
attributes are included primarily to
assist creation of table blocks by function tblBlocks
.
The inclusion of the hjust
column is not tidy, since it is really a
graphical display property. However it is needed to carry forward
justification information that x
may have inherited from a
tabular
object.
The tblEntries
method for textTable
is the inverse of this
function: it will re-create a textTable
from a tblEntries
object.
An object of S3 class tblEntries
. This is a data frame with one
row per entry in the table. It contains descriptors with information
about the nature and position of each entry within the table. Column
descriptions are in the documentation for the elements
function.
Additional details for certain columns are:
subpart |
For row and column headers, the subpart will be the name of the
corresponding column in |
level_in_layer |
Numbering of entries within a given part and headlayer. For row and
column headers this is based their hierarchical structure (see
|
type |
Character string identifying the type of value the entry represents (e.g.,
"numeric"). This is taken from the |
textspec |
Character string indicating any special features of the text in
|
enabled |
Logical indicating whether the entry is to be displayed. This function
sets |
hjust |
Numeric horizontal justification specification for entry text (0=left,
0.5=center, 1=right, NA=unspecified). This is set based on the
|
Row names for the data frame are set equal to id
. The data frame
has attributes mergeRuns
and rowheadInside
, based on the
arguments. It also has attributes rowhier
and colhier
,
containing information about the row and column header hierarchies. They
are lists of data frames, copied from the corresponding components of
x
. They reflect the logical structure of the headers and are
unaffected by display choices such as mergeRuns
and
rowheadInside
.
textTable
, tblParts
;
as.tblEntries
, elements
.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.