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

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)

Value

gtsummary object

Details

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

Example Output

Examples

library(gtsummary)
#> #Uighur
#> 
#> Attaching package: ‘gtsummary’
#> The following object is masked from ‘package:bstfun’:
#> 
#>     trial

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