Generates a forest plot using ggplot2 from a data frame containing
estimates, confidence intervals, and sample sizes. This function is designed
to be a component of a combined table/plot output (e.g., used by g_forest()).
gg_forest_plot(data, header = "", xlim = c(0.1, 10), logx = TRUE, vline = 1)(data.frame)
A data frame (tibble) containing the plot data. It must include
columns: estimate, ci_lower,
ci_upper, and n (for point size).
Forest header
(numeric(2))
A numeric vector of length 2 specifying the limits of the x-axis
(e.g., c(0.1, 10)).
(logical(1))
A logical value indicating whether the x-axis should be log-transformed
(i.e., using ggplot2::scale_x_log10()). The default is TRUE, which is typical
for effect measures like Odds Ratios or Hazard Ratios.
(numeric(1))
A numeric value specifying the x-intercept for the vertical
reference line (line of no effect). The default is 1.
A 'ggplot' object representing the forest plot.