justify: Align one set of cells with another set

Description Usage Arguments Examples

View source: R/justify.R

Description

If the header cells of a table aren't aligned to the left, right, top or bottom of the data cells that they describe, then use justify() to re-align them, using a second set of cells as a guide.

Usage

1
justify(header_cells, corner_cells)

Arguments

header_cells

Data frame of data cells with at least the columns 'row' and 'column', which are numeric or integer.

corner_cells

Data frame of header cells with at least the columns 'row' and 'column', which are numeric/integer vectors. The same length as header_cells.

Examples

1
2
3
4
5
6
header_cells <- tibble::tibble(row = c(1L, 1L, 1L, 1L),
                               col = c(3L, 5L, 8L, 10L),
                               value = LETTERS[1:4])
corner_cells <- tibble::tibble(row = c(2L, 2L, 2L, 2L),
                               col = c(1L, 4L, 6L, 9L))
justify(header_cells, corner_cells)

nacnudus/unpivotr documentation built on March 26, 2020, 2:39 a.m.