Open jameshowison opened 7 years ago
It would be quite handy to have some option like mergedcells = c("fill", "missing")
with possibly some other sensible alternatives. I was going to suggest it as a feature if it weren't already suggested.
+1. Merged cells are the bane of my existence.
How about fill(..., .direction = "right")
?
+1. Can't believe this is not already implemented somehow.
EDIT: OK I just discovered the existence of tidyxl
and unpivotr
, so maybe this is the recommended way to go. Still, this adds some technical complexity to something that should be simple.
Moving discussion from: https://github.com/tidyverse/readxl/pull/220#issuecomment-298394447
Currently (I think) merged cells are handled by placing the value in the left-top cell of the range and placing NA in all other cells. Makes sense in many situations.
Another useful option might be to repeat the value across the previously merged range. That would, for example, be helpful in tidying files with multiple headers, as detailed here: https://howisonlab.github.io/datawrangling/Handling_multi_indexes.html#a-tidyverse-solution
However, with your suggestions from the other thread, tidyr::fill works for this sensibly if one does a little transposing:
Nonetheless, an option to unmerge and fill all cells might still be useful.