add_inline_forest_plot: Add inline forest plot

Description Usage Arguments Details Value Example Output Examples

View source: R/add_inline_forest_plot.R

Description

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

Usage

1
2
3
4
5
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

Examples

1
2
3
4
5
6
7
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 4, 2021, 9:39 a.m.