View source: R/prBlocks.bare.R
prBlocks | R Documentation |
Assign graphical properties to table blocks (rectangular sets of table
cells), based on a style and scaling factor. This creates plot-ready
(pr
) blocks. This is an internal function, not intended to be
called by package users.
prBlocks(x, style=tablesggOpt("blockStyle"), scale=1.0)
x |
A |
style |
A |
scale |
Numeric multiplier used to increase or decrease the displayed size of
certain block properties, relative to the natural size implied by
|
The graphical properties available for a block, and their types, are
defined in object grProps
. They include both color and alpha used
to fill the area occupied by the block, and the color and thickness of the
border drawn around the block. When rendering a table, blocks are drawn
first so that they will not obscure entries or hvrules.
See styleObj
for information about how a style is specified, and
how it is applied to blocks. Note that individual style specifications
(rows) in style
are applied to x
in order. If a block
matches more than one style
row, the last matching row will
override the earlier ones.
All blocks are disabled by default; i.e., they will not be displayed when
a table is plotted. Selected blocks can be enabled by editing a
prBlocks
object like a data frame, or by modifying an existing plot
using the props<-
function.
An object of S3 classes prBlocks
, tblBlocks
, and
data.frame
. It has the same rows and columns as x
(one row
per block), plus additional or updated columns containing the graphical
properties to use for each block (shading and borders); logical column
enabled
(indicating whether the block is to be made visible when
the table is rendered, by shading and/or a border); and column
style_row
(the number of the last row in style
that the
block matched, or NA if it matched none).
Row names for the data frame are set equal to block id
. The object
has several additional attributes: current_scale
and style
,
based on the scale
and style
arguments after applying
defaults; and rowgroupSize
and rowheadInside
, copied from
x
.
elements
documents the descriptors and graphical properties
for blocks. tblBlocks
defines a default set of blocks that
reflect the logical structure of the table. styleObj
creates styles.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.