Skip to contents

This function creates a deterministic binary indicator of environmental suitability for cholera transmission based on epidemic peak periods identified by the est_epidemic_peaks() function. It uses the exact peak_start and peak_stop dates without any modifications or lead-up periods.

Usage

get_cases_binary_from_peaks(PATHS)

Arguments

PATHS

List of paths generated by get_paths() containing MODEL_INPUT path for accessing the epidemic peaks data file.

Value

A function that takes a data frame and returns it with an additional cases_binary column containing the binary environmental suitability indicator (0 = unsuitable, 1 = suitable). The input data frame must contain columns: iso_code and date.

Details

This function implements a deterministic approach for creating environmental suitability indicators:

Deterministic Epidemic Peak Method:

  1. Loads epidemic peak periods from param_epidemic_peaks.csv

  2. Marks all weeks from peak_start to peak_stop as suitable (1)

  3. Uses exact dates without any lead-up periods or duration filters

  4. Countries without epidemic peaks have cases_binary = 0 for all periods

Key Features:

  • Deterministic behavior - no parameters that can alter the peak periods

  • Direct use of peak_start and peak_stop dates from epidemic analysis

  • No fallback methods or threshold-based logic

  • Preserves missing data periods (NA) as non-suitable

Note

Requires param_epidemic_peaks.csv file generated by est_epidemic_peaks(). If this file is missing, the function will stop with an error.

See also

est_epidemic_peaks for epidemic peak detection compile_suitability_data for the main data processing pipeline

Examples

if (FALSE) { # \dontrun{
# Load and apply epidemic peaks to data
PATHS <- get_paths()
peak_function <- get_cases_binary_from_peaks(PATHS)
data_with_binary <- peak_function(data)
} # }