
Convert Bootstrap Summary Tables to flextable Objects
Source:R/summary_to_gt.R
summary_to_flextable.Rd
Converts tables created using boot_summary
and censboot_summary
to nicely formatted flextable
tables.
Examples
# Bootstrap summary of a linear model for mtcars:
model <- lm(mpg ~ hp + vs, data = mtcars)
boot_summary(model, R = 99) |> summary_to_flextable()
Estimate
95 % CI
p-value
(Intercept)
26.963
(22.414, 33.997)
<0.01
hp
-0.055
(-0.088, -0.032)
<0.01
vs
2.576
(-1.672, 5.825)
0.31
# Export to Word:
if (FALSE) { # \dontrun{
boot_summary(model, R = 99) |>
summary_to_flextable() |>
flextable::save_as_docx(path = "my_table.docx")
} # }