add_inline_forest_plot: Add inline forest plot

View source: R/add_inline_forest_plot.R

add_inline_forest_plotR Documentation

Add inline forest plot

Description

This function works with HTML output from the gt package only. Adds an in-line forest plot to a summary table.

Usage

add_inline_forest_plot(
  x,
  header = "**Forest Plot**",
  spec_pointrange.args = NULL
)

Arguments

x

a gtsummary object

header

string indicating column header of new forest plot column. Default is "**Forest Plot**".

spec_pointrange.args

named list of arguments that will be passed to kableExtra::spec_pointrange(). Use this argument to modify the default ascetics of the forest plot, e.g. color, size, symbols, etc. Default is list(width = 250, cex = .75, col = "black", pch = 16)

Details

Estimates from tbl_regression() and tbl_uvregression() that have been exponentiated are shown on the log scale.

Value

gtsummary object

Example Output

See Also

Other gtsummary-related functions: add_sparkline(), as_ggplot(), bold_italicize_group_labels(), logistic_reg_adj_diff(), style_tbl_compact(), tbl_likert(), theme_gtsummary_msk()

Examples

library(gtsummary)

# Example 1 ----------------------------------
add_inline_forest_plot_ex1 <-
  lm(mpg ~ cyl + am + drat, mtcars) %>%
  tbl_regression() %>%
  add_inline_forest_plot()


ddsjoberg/bstfun documentation built on May 14, 2022, 8:56 p.m.