build_forest_ggplot: Build a forest plot from prepared data

View source: R/main.R

build_forest_ggplotR Documentation

Build a forest plot from prepared data

Description

Internal function that handles all ggplot construction for forest plots. Called by forestplotMV and forestplotUV after data preparation.

Usage

build_forest_ggplot(
  tab,
  x_lab,
  show_linetype = FALSE,
  colours = "default",
  showEst = TRUE,
  showRef = TRUE,
  logScale = TRUE,
  nxTicks = 5,
  showN = TRUE,
  showEvent = TRUE,
  xlim = NULL
)

Arguments

tab

data frame prepared by prepare_forest_data and order_forest_data

x_lab

character label for the x-axis

show_linetype

logical, should adjusted/unadjusted be distinguished by linetype and shape? TRUE when showing both adjusted and unadjusted.

colours

colour specification: "default" or a vector of 3 colours for risks less than, equal to, and greater than 1.0

showEst

logical, should estimates be shown in labels?

showRef

logical, should reference levels be shown?

logScale

logical, should x-axis be log-scaled?

nxTicks

number of x-axis tick marks

showN

logical, show N on secondary axis?

showEvent

logical, show events on secondary axis?

xlim

numeric vector of length 2 for x-axis limits, or NULL


reportRmd documentation built on March 20, 2026, 5:06 p.m.