ml_plot: Combined Publication-Ready Trajectory Figure

View source: R/ml_plot.R

ml_plotR Documentation

Combined Publication-Ready Trajectory Figure

Description

Produces a multi-panel figure combining the pooled trajectory, confidence band, spline fit (if supplied), and ITCV sensitivity profile. Designed for direct inclusion in manuscripts.

Usage

ml_plot(
  meta_obj,
  sens_obj = NULL,
  bench_obj = NULL,
  spline_obj = NULL,
  frag_obj = NULL,
  ncol = NULL,
  main = NULL,
  col_effect = "#2166ac",
  col_sens = "#d73027",
  col_spline = "#1a9641",
  delta = NULL
)

Arguments

meta_obj

Output from ml_meta() (required).

sens_obj

Output from ml_sens() (optional; adds ITCV panel).

bench_obj

Output from ml_benchmark() (optional; adds benchmark marks).

spline_obj

Output from ml_spline() (optional; overlays spline).

frag_obj

Output from ml_fragility() (optional; adds fragility panel).

ncol

Number of columns in the panel layout. Default auto.

main

Overall figure title.

col_effect

Colour for the pooled effect trajectory.

col_sens

Colour for the ITCV line.

col_spline

Colour for the spline curve.

delta

Fragility benchmark line on the ITCV panel. Inherits from sens_obj if available.

Value

Invisibly returns a list of the objects passed in.

Examples

dat  <- sim_longitudinal_meta(k = 10, times = c(0, 6, 12), seed = 1)
meta <- ml_meta(dat, yi = "yi", vi = "vi", study = "study", time = "time")
sens <- ml_sens(dat, meta, yi = "yi", vi = "vi", study = "study", time = "time")
ml_plot(meta, sens_obj = sens)


spl  <- ml_spline(meta, df = 2)
ml_plot(meta, sens_obj = sens, spline_obj = spl,
        main = "Longitudinal Meta-Analysis Profile")



metaLong documentation built on March 31, 2026, 1:07 a.m.