br_show_forest {bregr}R Documentation

Show a forest plot for regression results

Description

[Stable]

This function takes regression results and formats them into a forest plot display. It handles:

Usage

br_show_forest(
  breg,
  clean = TRUE,
  rm_controls = FALSE,
  ...,
  subset = NULL,
  drop = NULL,
  tab_headers = NULL
)

Arguments

breg

A regression object with results (must pass assert_breg_obj_with_results()).

clean

Logical indicating whether to clean/condense redundant group/focal variable labels. If TRUE, remove "Group" or "Focal" variable column when the values in the result table are same (before performing subset and drop), and reduce repeat values in column "Group", "Focal", and "Variable".

rm_controls

If TRUE, remove control terms.

...

Additional arguments passed to forestploter::forest(), run vignette("forestploter-post", "forestploter") to see more plot options.

subset

Expression for subsetting the results data (br_get_results(breg)).

drop

Column indices to drop from the display table.

tab_headers

Character vector of custom column headers (must match number of displayed columns).

Value

A plot

See Also

Other br_show: br_show_fitted_line(), br_show_fitted_line_2d(), br_show_forest_ggstats(), br_show_forest_ggstatsplot(), br_show_risk_network(), br_show_table(), br_show_table_gt()

Examples

m <- br_pipeline(mtcars,
  y = "mpg",
  x = colnames(mtcars)[2:4],
  x2 = "vs",
  method = "gaussian"
)
br_show_forest(m)
br_show_forest(m, clean = TRUE, drop = 3)
br_show_forest(m, clean = FALSE)

[Package bregr version 1.0.0 Index]