Learn R Programming

climatehealth (version 1.0.0)

plot_rr_by_pm: Plot relative risk by PM2.5 levels for all regions and individually

Description

Generates one or more plots showing relative risk estimates across PM2.5 levels. If multiple regions are present, plots are created per region and for all regions combined. Optionally saves the output as a PDF.

Usage

plot_rr_by_pm(data, save_fig = FALSE, output_dir = NULL)

Value

No return value. Generates one or more plots and optionally saves them to disk.

Arguments

data

A data frame with columns: pm_levels, relative_risk, ci_lower, ci_upper, and region.

save_fig

Logical. If TRUE, saves the plot(s) as a PDF file in output_dir. Defaults to FALSE.

output_dir

Character. Directory path where the PDF file will be saved if save_fig is TRUE. Must exist. Defaults to NULL.