unmerge_headers(sheet, xr, horizontal = TRUE, sep = ":")
worksheet
objectcellranger::cell_limits
object)
indicating the region to collapse. This is going to be relative
to the view for now, until I work out how to use the new
relative references.TRUE
, the default) or a vertical
region. If horizontal we collapse away vertical spaces to
create a single header row. If vertical, we collapse away
horizontal space to create a single row names column.:
). Because of the sheets this is
designed to work with, you're never going to get syntactically
valid names here, so feel free to use anything. This can be
multiple characters, a newline, whatever. Likely you're going
to have to process these names a bit later.| -------X------- | | a | b | c |
which typically is intended to be interpreted as:
| X:a | X:b | X:c |
The same thing happen on rows, too. I suspect that this is generalisable to more than 2 columns.
Within such header rows are either: vertically merged:
| X | ===> | X | | | |
or stacked
| X | ===> | X:a | | a |
or stacked and blank
| X | or | | ===> | X | | | | X |
I want to write something that handles this, that can be hooked up to act as the "header" section on a view. For now, let's apply it to all cells within a range.