library(officer)
library(flextable)
z <- data.frame(
Statistic = c("Median (Q1 ; Q3)", "Min ; Max"),
Value = c(
"\t999.99\t(99.9 ; 99.9)",
"\t9.99\t(9999.9 ; 99.9)"
)
)
ts <- fp_tabs(
fp_tab(pos = 0.4, style = "decimal"),
fp_tab(pos = 1.4, style = "decimal")
)
zz <- flextable(z) |>
tab_settings(j = 2, value = ts) |>
width(width = c(1.5, 2))
save_as_docx(zz, path = tempfile(fileext = ".docx"))
Run the code above in your browser using DataLab