Consider the following example:
library(modelsummary)
library(flextable)
library(officer)
modlm <- lm(gear ~ mpg + wt, data = mtcars)
res <- modelsummary(
modlm,
stars = TRUE,
out = "flextable"
)
If I save the resulting flextable as HTML, I get an horizontal line that separates estimates from goodness of fit measures:
res |> flextable::save_as_html(path="test.html")
However, if I save the flextable as docx, I lose such line:
section_prop <- officer::prop_section(
page_size = officer::page_size(
orient = "landscape"
)
)
res |> flextable::save_as_docx(path="test.docx", pr_section=section_prop)
How can I have the horizontal line back?
This appears to be a bug. Could you report the issue here?
In the meantime, you may fix it manually like so (works on MacOS):
res <- res |> hline(i = 6, border = fp_border(color = "black"), part = "body")
Word Screenshot: