adjacent_blocks: Identify Adjacent Blocks of Table Cells

Description Usage Arguments Details Value See Also

View source: R/adjacent_blocks.bare.R


For each block of table cells in a tblBlocks object, identify the other blocks that are adjacent to it on each side. This is an internal utility function, not intended to be called by package users.





A tblBlocks object, defining a collection of rectangular blocks of cells in a table.


A block B is considered adjacent to block A if (a) the blocks do not intersect (have no cells in common); and (b) the blocks touch along at least part of one edge (they span overlapping sets of rows in adjacent columns, or overlapping sets of columns in adjacent rows).

It requires storage and time proportional to the square of the number of blocks. For realistic tables this is not likely to be a problem.


A list array with one row per block in x, and four columns. The rows are named by the block id, and the columns as "top", "right", "bottom", and "left". Element [[i, j]] is a character vector containing the ID's of all blocks that are adjacent to block i on side j. If there are no adjacent blocks, the element is character(0).

See Also


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