-
Notifications
You must be signed in to change notification settings - Fork 92
Description
(I think this is a FR, but a bug.)
I have an existing flextable chain that produces a good table. From there, I have been manually (in Word) shifting the first column to a row-group header: add a row above, merge the cells, copy the value in, then eventually delete the first column.
I think this is what as_flextable(spread_first_col=TRUE) is supposed to enable. However, I have a regular flextable() on the data. I have no need to tabulate or summarize it, that's already been done, so I don't need (I think) summarizor() or tabulator(), therefore I cannot use as_flextable().
In the end, I'm hoping for something like this using spread_first_col=TRUE, and I can't figure out how to do it with a vanilla frame.
library(dplyr)
library(flextable)
relocate(mtcars, cyl, .before = everything()) |>
arrange(cyl) |>
flextable() |>
save_as_docx(path="mytable.docx")I think in the interim I could hand-jam using merge_h_range() to insert rows, merge the columns, etc. Is there a better way to do that?