This is the main wrapper function that takes a 'gtsummary' object,
converts it to a 'ggplot' table, extracts the necessary data, creates
a forest plot, and combines the two plots side-by-side using +.
This likely relies on the patchwork package for plot combination.
g_forest(tbl)(gtsummary)
A 'gtsummary' object (e.g., from gtsummary::tbl_regression()).
A combined 'ggplot' object (likely a 'patchwork' object) showing the table on the left and the forest plot on the right.
if (FALSE) { # identical(Sys.getenv("NOT_CRAN"), "true")
tbl <-
trial |>
tbl_roche_subgroups(
rsp = "response",
by = "trt",
subgroups = c("grade", "stage"),
~ glm(response ~ trt, data = .x) |>
gtsummary::tbl_regression(
show_single_row = trt,
exponentiate = TRUE
)
)
if (FALSE) { # \dontrun{
g_forest(tbl)
} # }
}