prBlocks: Assign Graphical Properties to Table Blocks

Description Usage Arguments Details Value See Also

View source: R/prBlocks.bare.R

Description

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.

Usage

1
prBlocks(x, style=tablesggOpt("blockStyle"), scale=1.0)

Arguments

x

A tblBlocks object, containing the locations, and possibly other descriptors, of table blocks.

style

A styleObj object, specifying the graphical properties to assign to blocks based on their place in the structure of the table or other descriptors in x. The default is taken from tablesggOpt().

scale

Numeric multiplier used to increase or decrease the displayed size of certain block properties, relative to the natural size implied by style. The default is 1.0.

Details

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.

Value

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.

See Also

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.


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