prEntries: Assign Graphical Properties to Table Entries

Description Usage Arguments Details Value See Also

View source: R/prEntries.bare.R

Description

Assign graphical properties to table entries, based on a style and scaling factor. This creates fully plot-ready (pr) entries. This is an internal function, not intended to be called by package users.

Usage

1
prEntries(x, style=tablesggOpt("entryStyle"), scale=1.0)

Arguments

x

A tblEntries object, containing the contents, locations, and possibly other descriptors, of table entries.

style

A styleObj object, specifying the graphical properties to assign to entries 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 entries, relative to the natural size implied by style. The default is 1.0.

Details

The graphical properties available for an entry, and their types, are defined in object grProps. They include both properties for the entry text itself (size, font, color, etc) and for the cell(s) containing the entry (background color, border thickness and color).

Justification of text within a cell is specified by properties hjust and vjust. Their interpretation is with respect to the boundaries of the cell: 0 means justification toward the left/top of the cell, 1 means toward the right/bottom, and 0.5 means centered.

See styleObj for information about how a style is specified, and how it is applied to entries. Note that individual style specifications (rows) in style are applied to x in order. If an entry matches more than one style row, the last matching row will override the earlier ones.

One can also assign or modify graphical properties directly, without using a style, by editing a prEntries object like a data frame. Properties in an existing plot can also be modified using the props<- set of functions.

Value

An object of S3 classes prEntries, tblEntries, and data.frame. It has the same rows and columns as x (one row per entry), plus additional or updated columns containing the graphical properties to use for each entry, plus a column style_row (the number of the last row in style that the entry 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 mergeRuns, rowheadInside, rowhier, and colhier, copied from x.

See Also

elements documents the descriptors and graphical properties for blocks. tblEntries; styleObj creates styles; as.prEntries.


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