save_table: Save a Single Regression Table

View source: R/save_functions.R

save_tableR Documentation

Save a Single Regression Table

Description

Saves a gtsummary table as a Word, PDF, or HTML file

Usage

save_table(tbl, filename = "table", format = c("docx", "pdf", "html"))

Arguments

tbl

A gtsummary object (e.g., tbl_regression(), tbl_summary()).

filename

File name to save the output. Extension is optional.

format

Output format. One of "docx", "pdf", or "html".

Value

Saves the file to a temporary directory (if no path is given). Does not return an object.

Examples


model <- glm(mpg ~ hp + wt, data = mtcars)
tbl <- gtsummary::tbl_regression(model)
save_table(tbl, filename = file.path(tempdir(), "regression_table"), format = "docx")


gtregression documentation built on Aug. 18, 2025, 5:23 p.m.