Learn R Programming

climatehealth (version 1.0.0)

plot_aggregated_AF: Plots attributable fractions and CI across years by regions

Description

Generates a PDF containing one or more plots of average attributable fractions over time. If by_region is TRUE, the function creates separate plots for each region. All plots are saved to a single PDF file named "aggregated_AF_by_region.pdf" in the specified output_dir.

Usage

plot_aggregated_AF(data, by_region = FALSE, output_dir = ".")

Value

No return value. A PDF file is created.

Arguments

data

A data frame containing annual attributable fraction estimates. Must include columns: year, average_attributable_fraction, lower_ci_attributable_fraction, upper_ci_attributable_fraction. If by_region is TRUE, must also include region.

by_region

Logical. If TRUE, plots are generated per region using region. Defaults to FALSE.

output_dir

Character. Directory path where the PDF file will be saved. Must exist. Defaults to ".".