vincentarelbundock / modelsummary

Beautiful and customizable model summaries in R.
http://modelsummary.com
Other
896 stars 74 forks source link

Question on flextable in last version (2.1.0) of modelsummary #773

Closed iago-pssjd closed 1 month ago

iago-pssjd commented 1 month ago

Hi!

msT2 is a modelsummary with output = "flextable" to which I apply the next flextable functions

msT2 <- set_table_properties(msT2, layout = "fixed") |>
    width(j = 1, width = 6, unit = "cm") |>
    width(j = c(2,4), width = 3, unit = "cm") |> 
    width(j = c(3,5), width = 4, unit = "cm") |>
    fontsize(size = 9, part = "all") |>
    separate_header(split = " / ")

In version 2.0.0 it worked (and also in version b5c0b61a0679fd16c4cd2f53ec0bfc48594e72c6 of on 24th April). However now, with the current release 2.1.0 I get

Error in `separate_header()`:
! the flextable object already have additional row(s),
run `separate_header()` before any header row augmentation
Backtrace:
 1. flextable::separate_header(...)

I see in the NEWS file that "flextable: Support spanning column headers" and I assume this is related. How should I proceed?

Thanks!

iago-pssjd commented 1 month ago

Well, I see I only have to remove that line since the new processing already does that job. However, I miss some more documentation on this change (separate_headeralso could be used for other reasons).

Thanks!