This:
(1) for each row: checks that subsequent columns are identical (and corresponding sub-header overlap), so should be merged
(2) for each column: checks that subsequent rows are identical, so should be merged
filters cells planned to be merged across rows (2) if they are already merged across columns (1)
mergeHeaderCols(x, mapping)
Updated flextable object with merged cells in the header.
a flextable
object
a data.frame
specyfing for each colname
content of the column.