Learn R Programming

climatehealth (version 1.0.0)

plot_ar_pm_monthly: Plot monthly deaths and PM2.5 concentrations with dual y-axes

Description

Aggregates data by month and creates a dual-axis plot showing average deaths per 100,000 and mean PM2.5 concentrations.

Usage

plot_ar_pm_monthly(data, save_outputs = FALSE, output_dir = NULL)

Value

No return value. Generates a plot and optionally saves files.

Arguments

data

A data frame with columns: month, deaths_per_100k, and monthly_avg_pm25. Month names must match month.abb.

save_outputs

Logical. If TRUE, saves the plot as PNG and the aggregated data as CSV. Defaults to FALSE.

output_dir

Character. Directory path where outputs are saved if save_outputs is TRUE. Must exist. Defaults to NULL.