tblHvrules: Create Horizontal and Vertical Rules for a Table

Description Usage Arguments Details Value See Also

View source: R/tblHvrules.bare.R

Description

Create horizontal and vertical rules (hvrules) for a table, based on blocks of table entries. This is an internal utility function, not intended to be called directly by package users.

Usage

1

Arguments

x

A tblBlocks object specifying blocks of cells in a 2D table. If NULL, no hvrules are created.

Details

This function creates four hvrules per block: two hrules that run along the top and bottom sides of the block, and two vrules that run along the left and right sides of the block. All of the generated hvrules are disabled by default.

No graphical properties of the hvrules, such as the size of the inserted rectangle or the appearance of the line within it, are assigned by this function. hvrules can be selectively enabled and given graphical properties by applying a style (see styleObj) to create plot-ready hvrules (a prHvrule object). Properties in an existing plot can also be modified using the props<- function.

Value

An object of S3 class tblHvrules, which is a data frame with each row specifying one hvrule for the table. If there are no hvrules, the data frame will have no rows. Columns are:

id

A unique identifier for the hvrule. This function creates identifiers using the format <block>_<side>.

direction

Either "hrule" for a horizontal rule or "vrule" for a vertical rule.

block

The identifier of the block along the side of which the hvrule runs.

side

Which side of the block the hvrule runs along, "top", "bottom", "left", or "right".

adjacent_blocks

Character string containing the IDs of blocks that are adjacent to block on the same side as the hvrule. (I.e., blocks that are separated from block by the hvrule.) Block IDs within the string are separated by semicolons. If there are no adjacent blocks the string will be empty ("").

arow1, arow2, acol1, acol2

Location of the hvrule with respect to the expanded row-column grid of the table. An hrule is inserted between table rows, and therefore arow1 and arow2 are the same and equal to a half-integer. For example, an hrule inserted between rows 3 and 4 has arow1 = arow2 = 3.5. acol1 and acol2 for the hrule are integers indicating the range of columns that it spans. Analogously, a vrule is inserted between table columns, so acol1 and acol2 are identical and equal to a half-integer, while arow1 and arow2 are integers that indicate the range of rows spanned by the vrule.

enabled

Logical indicating whether the hvrule is to be displayed. This function sets enabled to FALSE for all hvrules. See DETAILS for information about enabling selected hvrules.

Row names for the data frame are set equal to id.

See Also

tblBlocks defines a default set of blocks that reflect the logical structure of the table. This function is called by internal function apply_style.


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