Learn R Programming

MAPCtools (version 0.1.0)

plot_time_effect: Plot time effects with uncertainty ribbons

Description

Internal plotting helper to visualize median differences over time (or other x-axis), including HPD interval ribbons and stratified lines.

Usage

plot_time_effect(
  data,
  x_lab,
  y_lab,
  family,
  color_palette,
  plot_theme,
  legend_title = "Strata"
)

Value

A ggplot object.

Arguments

data

A data frame with columns: x, median_differences, hpd_lower, hpd_upper, Strata.

x_lab

Label for the x-axis.

y_lab

Label for the y-axis.

family

A string indicating model family ("binomial", "poisson", or other).

color_palette

A named vector of colors for strata.

plot_theme

A ggplot2 theme object.

legend_title

Title for the legend.