Learn R Programming

climatehealth (version 1.0.0)

plot_health_climate_timeseries: Plot Time Series of Health and Climate Variables

Description

Generate time series plots for combined health and climate data prepared for spatiotemporal and DLNM analysis. Supports aggregation at the country, region, or district level.

Usage

plot_health_climate_timeseries(
  data,
  param_term,
  level = "country",
  filter_year = NULL,
  case_type,
  save_fig = FALSE,
  output_dir = NULL
)

Value

A ggplot object.

Arguments

data

A data frame containing the combined health and climate data.

param_term

Character. The variable to plot (e.g., tmax, tmean, tmin, Malaria). Use "all" to include all available variables.

level

Character. Aggregation level: one of "country", "region", or "district". Defaults to "country".

filter_year

Optional numeric vector to filter data by year(s). Defaults to NULL.

case_type

Character. The type of disease that the case column refers to. Must be one of 'diarrhea' or 'malaria'.

save_fig

Boolean. Whether to save the figure as a PDF. Defaults to FALSE.

output_dir

Character. Directory path to save the figure. Default to NULL