diff --git a/DESCRIPTION b/DESCRIPTION
index f35c066..562035f 100644
--- a/DESCRIPTION
+++ b/DESCRIPTION
@@ -19,10 +19,12 @@ LazyData: true
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.3.1
Imports:
+ arrow,
cowplot,
countrycode,
dplyr,
elevatr,
+ FNN,
ggplot2,
ggraph,
ggrepel,
@@ -35,6 +37,7 @@ Imports:
jsonlite,
lubridate,
magrittr,
+ minpack.lm,
mobility,
propvacc,
raster,
@@ -51,8 +54,7 @@ Imports:
remotes,
scales,
shiny,
- arrow,
- minpack.lm
+ shinyWidgets
Depends:
R (>= 4.1.1),
stats,
diff --git a/NAMESPACE b/NAMESPACE
index 4cdd255..02f6c70 100644
--- a/NAMESPACE
+++ b/NAMESPACE
@@ -28,11 +28,11 @@ importFrom("lubridate", "ceiling_date")
importFrom("glue", "glue")
importFrom("propvacc", "get_beta_params")
importFrom("tidyr", "pivot_longer")
-importFrom("stats", "aggregate", "cor", "median", "optim", "quantile")
+importFrom("stats", "aggregate", "cor", "median", "optim", "quantile", "vcov")
+importFrom("stats", "dbeta", "density", "dgamma", "dlnorm", "qgamma", "rbeta", "runif")
importFrom("utils", "install.packages", "installed.packages")
importFrom("arrow", "write_parquet", "read_parquet")
importFrom("minpack.lm", "nls.lm", "nls.lm.control")
importFrom("grDevices", "colorRampPalette")
importFrom("graphics", "legend", "lines", "points", "text")
-importFrom("stats", "dbeta", "density", "dgamma", "dlnorm", "qgamma",
- "rbeta", "runif")
+
diff --git a/R/download_climate_data.R b/R/download_climate_data.R
index cc9cdf6..2c029b4 100644
--- a/R/download_climate_data.R
+++ b/R/download_climate_data.R
@@ -1,6 +1,6 @@
-#' Download and Save Climate Data for Multiple Countries (Parquet Format, Single Model)
+#' Download and Save Climate Data for Multiple Countries (Parquet Format, Multiple Models and Variables)
#'
-#' This function downloads daily climate data for a list of specified countries, saving the data as Parquet files. The data includes both historical and future climate variables at grid points within each country for a specified climate model.
+#' This function downloads daily climate data for a list of specified countries, saving the data as Parquet files. The data includes both historical and future climate variables at grid points within each country for a specified set of climate models and variables.
#'
#' @param PATHS A list containing paths where raw and processed data are stored.
#' PATHS is typically the output of the `get_paths()` function and should include:
@@ -13,7 +13,7 @@
#' @param n_points An integer specifying the number of grid points to generate within each country for which climate data will be downloaded.
#' @param date_start A character string representing the start date for the climate data (in "YYYY-MM-DD" format).
#' @param date_stop A character string representing the end date for the climate data (in "YYYY-MM-DD" format).
-#' @param climate_model A single character string representing the climate model to use. Available models include:
+#' @param climate_models A character vector of climate models to use. Available models include:
#' \itemize{
#' \item \strong{CMCC_CM2_VHR4}
#' \item \strong{FGOALS_f3_H}
@@ -23,12 +23,25 @@
#' \item \strong{MPI_ESM1_2_XR}
#' \item \strong{NICAM16_8S}
#' }
+#' @param climate_variables A character vector of climate variables to retrieve. See details for available variables.
#'
-#' @return The function does not return a value. It downloads the climate data for each country and saves the results as Parquet files in the specified directory.
+#' @return The function does not return a value. It downloads the climate data for each country, climate model, and climate variable, saving the results as Parquet files in the specified directory.
#'
-#' @details This function uses country shapefiles to generate a grid of points within each country, at which climate data is downloaded. The function retrieves climate data for the specified date range (`date_start` to `date_stop`) and the specified climate model. The data is saved for each country in a Parquet file named `climate_data_{climate_model}_{date_start}_{date_stop}_{ISO3}.parquet`.
+#' @details This function uses country shapefiles to generate a grid of points within each country, at which climate data is downloaded. The function retrieves climate data for the specified date range (`date_start` to `date_stop`) and the specified climate models and variables. The data is saved for each country, climate model, and climate variable in a Parquet file named `climate_data_{climate_model}_{climate_variable}_{date_start}_{date_stop}_{ISO3}.parquet`.
#'
-#' The climate data variables include temperature, wind speed, cloud cover, precipitation, and more. The function retrieves data from a single climate model.
+#' The available climate variables include:
+#' \itemize{
+#' \item \strong{temperature_2m_mean}, \strong{temperature_2m_max}, \strong{temperature_2m_min}
+#' \item \strong{wind_speed_10m_mean}, \strong{wind_speed_10m_max}
+#' \item \strong{cloud_cover_mean}
+#' \item \strong{shortwave_radiation_sum}
+#' \item \strong{relative_humidity_2m_mean}, \strong{relative_humidity_2m_max}, \strong{relative_humidity_2m_min}
+#' \item \strong{dew_point_2m_mean}, \strong{dew_point_2m_min}, \strong{dew_point_2m_max}
+#' \item \strong{precipitation_sum}, \strong{rain_sum}, \strong{snowfall_sum}
+#' \item \strong{pressure_msl_mean}
+#' \item \strong{soil_moisture_0_to_10cm_mean}
+#' \item \strong{et0_fao_evapotranspiration_sum}
+#' }
#'
#' @importFrom dplyr select mutate
#' @importFrom lubridate year month week yday
@@ -46,10 +59,11 @@
#' # API key for climate data API
#' api_key <- "your-api-key-here"
#'
-#' # Download climate data for a specified model and save it for the specified countries
+#' # Download climate data for multiple models and variables and save it for the specified countries
#' download_climate_data(PATHS, iso_codes, n_points = 5,
#' date_start = "1970-01-01", date_stop = "2030-12-31",
-#' climate_model = "MRI_AGCM3_2_S", api_key)
+#' climate_models = c("MRI_AGCM3_2_S", "EC_Earth3P_HR"),
+#' climate_variables = c("temperature_2m_mean", "precipitation_sum"), api_key)
#'}
#'
#' @export
@@ -59,68 +73,74 @@ download_climate_data <- function(PATHS,
n_points,
date_start,
date_stop,
- climate_model,
+ climate_models,
+ climate_variables,
api_key) {
- if (length(climate_model) > 1) stop("One climate model at a time")
-
- # Ensure output directory exists, if not, create it
- if (!dir.exists(PATHS$DATA_CLIMATE)) {
- dir.create(PATHS$DATA_CLIMATE, recursive = TRUE)
- }
-
- # List of climate variables for both historical and future data
- climate_variables_historical_and_future <- c(
+ climate_variables <- c(
"temperature_2m_mean", "temperature_2m_max", "temperature_2m_min",
"wind_speed_10m_mean", "wind_speed_10m_max", "cloud_cover_mean",
"shortwave_radiation_sum", "relative_humidity_2m_mean",
"relative_humidity_2m_max", "relative_humidity_2m_min",
"dew_point_2m_mean", "dew_point_2m_min", "dew_point_2m_max",
- "precipitation_sum", "rain_sum", "snowfall_sum",
+ "precipitation_sum", "rain_sum",
"pressure_msl_mean", "soil_moisture_0_to_10cm_mean",
"et0_fao_evapotranspiration_sum"
)
- # Loop through each ISO3 country code
- for (country_iso_code in iso_codes) {
+ # Ensure output directory exists, if not, create it
+ if (!dir.exists(PATHS$DATA_CLIMATE)) {
+ dir.create(PATHS$DATA_CLIMATE, recursive = TRUE)
+ }
+
+ # Loop through each climate model
+ for (climate_model in climate_models) {
+
+ # Loop through each ISO3 country code
+ for (country_iso_code in iso_codes) {
+
+ # Loop through each climate variable
+ for (climate_variable in climate_variables) {
- message(glue::glue("Downloading daily climate data for {country_iso_code} using {climate_model} at {n_points} points"))
+ message(glue::glue("Downloading daily {climate_variable} data for {country_iso_code} using {climate_model} at {n_points} points"))
- # Convert ISO3 code to country name and read country shapefile
- country_name <- MOSAIC::convert_iso_to_country(country_iso_code)
- country_shp <- sf::st_read(dsn = file.path(PATHS$DATA_SHAPEFILES, paste0(country_iso_code, "_ADM0.shp")), quiet = TRUE)
+ # Convert ISO3 code to country name and read country shapefile
+ country_name <- MOSAIC::convert_iso_to_country(country_iso_code)
+ country_shp <- sf::st_read(dsn = file.path(PATHS$DATA_SHAPEFILES, paste0(country_iso_code, "_ADM0.shp")), quiet = TRUE)
- # Generate grid points within the country
- grid_points <- MOSAIC::generate_country_grid_n(country_shp, n_points = n_points)
- coords <- sf::st_coordinates(grid_points)
- coords <- as.data.frame(coords)
- rm(grid_points)
- rm(country_shp)
+ # Generate grid points within the country
+ grid_points <- MOSAIC::generate_country_grid_n(country_shp, n_points = n_points)
+ coords <- sf::st_coordinates(grid_points)
+ coords <- as.data.frame(coords)
+ rm(grid_points)
+ rm(country_shp)
- # Download climate data for the generated grid points
- climate_data <- MOSAIC::get_climate_future(lat = coords$Y,
- lon = coords$X,
- date_start = date_start,
- date_stop = date_stop,
- climate_variables = climate_variables_historical_and_future,
- climate_model = climate_model,
- api_key = api_key)
+ # Download climate data for the generated grid points for the current climate variable
+ climate_data <- MOSAIC::get_climate_future(lat = coords$Y,
+ lon = coords$X,
+ date_start = date_start,
+ date_stop = date_stop,
+ climate_variables = climate_variable, # Single variable per loop
+ climate_model = climate_model,
+ api_key = api_key)
- # Add additional metadata columns
- climate_data <- data.frame(
- country_name = country_name,
- iso_code = country_iso_code,
- year = lubridate::year(climate_data$date),
- month = lubridate::month(climate_data$date),
- week = lubridate::week(climate_data$date),
- doy = lubridate::yday(climate_data$date),
- climate_data
- )
+ # Add additional metadata columns
+ climate_data <- data.frame(
+ country_name = country_name,
+ iso_code = country_iso_code,
+ year = lubridate::year(climate_data$date),
+ month = lubridate::month(climate_data$date),
+ week = lubridate::week(climate_data$date),
+ doy = lubridate::yday(climate_data$date),
+ climate_data
+ )
- # Save climate data as Parquet, including the climate model in the file name
- arrow::write_parquet(climate_data,
- sink = file.path(PATHS$DATA_CLIMATE, paste0("climate_data_", climate_model, "_", date_start, "_", date_stop, "_", country_iso_code, ".parquet")))
+ # Save climate data as Parquet, including the climate model and variable in the file name
+ arrow::write_parquet(climate_data,
+ sink = file.path(PATHS$DATA_RAW, paste0("climate/climate_data_", climate_model, "_", climate_variable, "_", date_start, "_", date_stop, "_", country_iso_code, ".parquet")))
+ }
+ }
}
- message(glue::glue("Climate data saved for all countries using {climate_model} here: {PATHS$DATA_CLIMATE}"))
+ message(glue::glue("Raw climate data saved for all countries, variables, and models here: {PATHS$DATA_RAW}/climate"))
}
diff --git a/R/est_mobility.R b/R/est_mobility.R
index a2f4afc..2bf4ef9 100644
--- a/R/est_mobility.R
+++ b/R/est_mobility.R
@@ -15,7 +15,7 @@
#'
#' @importFrom ggplot2 ggplot aes geom_tile xlab ylab theme_bw element_text margin scale_fill_gradient guides guide_colorbar geom_segment geom_sf geom_point geom_text scale_size_continuous theme_void
#' @importFrom reshape2 melt
-#' @importFrom mobility fit_prob_travel fit_mobility mobility summary predict
+#' @importFrom mobility fit_prob_travel mobility summary predict
#' @importFrom sf st_read st_coordinates st_centroid
#' @importFrom dplyr left_join rename
#' @importFrom glue glue
diff --git a/R/est_seasonal_dynamics.R b/R/est_seasonal_dynamics.R
index c089bd4..dac06ad 100644
--- a/R/est_seasonal_dynamics.R
+++ b/R/est_seasonal_dynamics.R
@@ -1,13 +1,18 @@
-#' Get Seasonal Dynamics Data for Cholera and Precipitation
+#' Estimate Seasonal Dynamics for Cholera and Precipitation Using Fourier Series
#'
-#' This function retrieves historical precipitation data, processes cholera case data, fits seasonal dynamics models using Fourier series,
-#' and saves the results to a CSV file.
+#' This function retrieves historical precipitation data, processes cholera case data, and fits seasonal dynamics models using a double Fourier series. The results are saved to a CSV file, including parameter estimates, fitted values, and processed data.
#'
-#' @param PATHS A list containing paths where raw and processed data are stored. Typically generated by the `get_paths()` function.
+#' @param PATHS A list containing paths where raw and processed data are stored. Typically generated by the `get_paths()` function and should include:
+#' \itemize{
+#' \item \strong{DATA_CLIMATE}: Path to the directory where climate data is stored.
+#' \item \strong{DATA_SHAPEFILES}: Path to the directory containing country shapefiles.
+#' \item \strong{DATA_WHO_WEEKLY}: Path to the directory containing cholera data.
+#' \item \strong{MODEL_INPUT}: Path to the directory where model input files will be saved.
+#' }
#'
-#' @return The function saves the parameter estimates, fitted values, and processed data as CSV files.
+#' @return The function saves the parameter estimates, fitted values, and processed data to a CSV file.
#'
-#' @importFrom dplyr select mutate group_by summarize filter bind_rows
+#' @importFrom dplyr mutate group_by summarize bind_rows
#' @importFrom tidyr spread
#' @importFrom lubridate week year
#' @importFrom sf st_read st_coordinates
@@ -16,9 +21,15 @@
#' @importFrom ggplot2 ggplot geom_sf labs theme_minimal
#' @importFrom minpack.lm nlsLM
#' @export
-
est_seasonal_dynamics <- function(PATHS) {
+
+ requireNamespace('minpack.lm')
+ requireNamespace('FNN')
+ requireNamespace('sf')
+
+
+ # Load necessary country data
iso_codes <- MOSAIC::iso_codes_mosaic
# Load cholera cases data
@@ -27,6 +38,10 @@ est_seasonal_dynamics <- function(PATHS) {
iso_codes_with_data <- sort(unique(cholera_data$iso_code))
iso_codes_no_data <- setdiff(iso_codes, unique(cholera_data$iso_code))
+ ################################################################################
+ # Model seasonal dynamics of cases and precipitation using Fourier series
+ ################################################################################
+
all_precip_data <- list()
all_fitted_values <- list()
all_param_values <- list()
@@ -35,63 +50,145 @@ est_seasonal_dynamics <- function(PATHS) {
message(glue::glue("Processing country: {country_iso_code}"))
+ country_name <- MOSAIC::convert_iso_to_country(country_iso_code)
- # instead load climate data
-
- country_shp <- sf::st_read(file.path(PATHS$DATA_SHAPEFILES, paste0(country_iso_code, "_ADM0.shp")), quiet = TRUE)
- grid_points <- MOSAIC::generate_country_grid_n(country_shp, n_points = 10)
- coords <- sf::st_coordinates(grid_points)
- coords <- as.data.frame(coords)
-
- precipitation_data_list <- list()
-
- for (i in seq_len(nrow(coords))) {
- lat <- coords$Y[i]
- lon <- coords$X[i]
+ # Load climate data for the country
+ precip_file <- file.path(PATHS$DATA_CLIMATE, glue::glue("climate_data_MRI_AGCM3_2_S_precipitation_sum_1970-01-01_2030-12-31_{country_iso_code}.parquet"))
- precip_data <- get_historical_precip(lat, lon, as.Date("2014-09-01"), as.Date("2024-09-01"), api_key = "your_api_key_here")
- precip_data$year <- lubridate::year(precip_data$date)
- precip_data$week <- lubridate::week(precip_data$date)
+ # Check if the precipitation file exists
+ if (file.exists(precip_file)) {
+ message(glue::glue("Loading precipitation data from file for {country_iso_code}"))
+ precip_data <- arrow::read_parquet(file = precip_file)
+ } else {
+ stop(glue::glue("Precipitation data not found for {country_iso_code}."))
+ }
- weekly_precip <- precip_data %>%
- dplyr::group_by(year, week) %>%
- dplyr::summarize(weekly_precipitation_sum = sum(daily_precipitation_sum, na.rm = TRUE))
+ precip_data <- precip_data[precip_data$date >= '2014-09-01' & precip_data$date < '2024-09-01',]
- weekly_precip$iso_code <- country_iso_code
- precipitation_data_list[[i]] <- weekly_precip
- }
+ # Aggregate weekly precipitation data
+ precip_data <- precip_data %>%
+ mutate(week = lubridate::week(date), year = lubridate::year(date)) %>%
+ group_by(year, week) %>%
+ summarize(weekly_precipitation_sum = sum(value, na.rm = TRUE), .groups = 'drop')
- precip_data <- do.call(rbind, precipitation_data_list)
+ # Merge with cholera data by week and ISO code
+ precip_data$iso_code <- country_iso_code
precip_data <- merge(precip_data, cholera_data, by = c("week", "iso_code"), all.x = TRUE)
- # Scale precipitation and cholera data
- precip_data <- precip_data %>%
- dplyr::mutate(precip_scaled = scale(weekly_precipitation_sum),
- cases_scaled = scale(cases))
+ # Create a sequence of weeks for the fitted curve
+ week_seq <- seq(min(precip_data$week), max(precip_data$week), length.out = 100)
- # Fit Fourier series model for precipitation
- fit_precip <- minpack.lm::nlsLM(
- precip_scaled ~ generalized_fourier(week, beta0, a1, b1, a2, b2, p = 52),
+ # Scale the precipitation and cholera data
+ precip_data$precip_scaled <- scale(precip_data$weekly_precipitation_sum, center = TRUE, scale = TRUE)
+ precip_data$cases_scaled <- scale(precip_data$cases, center = TRUE, scale = TRUE)
+
+ # Fit the Generalized Fourier Series model to precipitation data using MOSAIC::fourier_series_double
+ fit_fourier_precip <- minpack.lm::nlsLM(
+ precip_scaled ~ MOSAIC::fourier_series_double(week, a1, b1, a2, b2, p = 52, beta0 = 0),
data = precip_data,
- start = list(beta0 = 0, a1 = 1, b1 = 1, a2 = 0.5, b2 = 0.5)
+ start = list(a1 = 1, b1 = 1, a2 = 0.5, b2 = 0.5)
)
- param_precip <- coef(summary(fit_precip))
+ # Extract coefficients and standard errors
+ coefs_precip <- coef(fit_fourier_precip)
+ se_precip <- sqrt(diag(vcov(fit_fourier_precip)))
+
param_values_precip <- data.frame(
+ country_name = country_name,
country_iso_code = country_iso_code,
response = "precipitation",
- parameter = rownames(param_precip),
- mean = param_precip[,"Estimate"],
- se = param_precip[,"Std. Error"],
- ci_lo = param_precip[,"Estimate"] - param_precip[,"Std. Error"] * 1.96,
- ci_hi = param_precip[,"Estimate"] + param_precip[,"Std. Error"] * 1.96
+ parameter = names(coefs_precip),
+ mean = coefs_precip,
+ se = se_precip,
+ ci_lo = coefs_precip - 1.96 * se_precip,
+ ci_hi = coefs_precip + 1.96 * se_precip
)
- all_param_values[[country_iso_code]] <- param_values_precip
+ # Use MOSAIC::fourier_series_double to calculate fitted values for precipitation
+ fitted_values_precip <- MOSAIC::fourier_series_double(week_seq, coefs_precip["a1"], coefs_precip["b1"], coefs_precip["a2"], coefs_precip["b2"], p = 52, beta0 = 0)
+
+ # Fit the Fourier series model to cholera cases if data is available
+ if (country_iso_code %in% iso_codes_with_data) {
+ fit_fourier_cases <- minpack.lm::nlsLM(
+ cases_scaled ~ MOSAIC::fourier_series_double(week, a1, b1, a2, b2, p = 52, beta0 = 0),
+ data = precip_data,
+ start = list(
+ a1 = coefs_precip["a1"],
+ b1 = coefs_precip["b1"],
+ a2 = coefs_precip["a2"],
+ b2 = coefs_precip["b2"]
+ )
+ )
+
+ coefs_cases <- coef(fit_fourier_cases)
+ se_cases <- sqrt(diag(vcov(fit_fourier_cases)))
+
+ param_values_cases <- data.frame(
+ country_name = country_name,
+ country_iso_code = country_iso_code,
+ response = "cases",
+ parameter = names(coefs_cases),
+ mean = coefs_cases,
+ se = se_cases,
+ ci_lo = coefs_cases - 1.96 * se_cases,
+ ci_hi = coefs_cases + 1.96 * se_cases
+ )
+
+ # Use MOSAIC::fourier_series_double to calculate fitted values for cholera cases
+ fitted_values_cases <- MOSAIC::fourier_series_double(week_seq, coefs_cases["a1"], coefs_cases["b1"], coefs_cases["a2"], coefs_cases["b2"], p = 52, beta0 = 0)
+ } else {
+ fitted_values_cases <- rep(NA, length(week_seq))
+
+ param_values_cases <- data.frame(
+ country_name = country_name,
+ country_iso_code = country_iso_code,
+ response = "cases",
+ parameter = names(coefs_precip),
+ mean = NA,
+ se = NA,
+ ci_lo = NA,
+ ci_hi = NA
+ )
+ }
+
+ # Store fitted values
+ fitted_values <- data.frame(
+ week = week_seq,
+ iso_code = country_iso_code,
+ fitted_values_fourier_precip = fitted_values_precip,
+ fitted_values_fourier_cases = fitted_values_cases
+ )
+
+ # Store results for each country
+ precip_data$Country <- country_name
+ fitted_values$Country <- country_name
+ param_values <- rbind(param_values_precip, param_values_cases)
+
all_precip_data[[country_iso_code]] <- precip_data
+ all_fitted_values[[country_iso_code]] <- fitted_values
+ all_param_values[[country_iso_code]] <- param_values
+
}
+ # Combine all results into a single dataframe
+ combined_precip_data <- do.call(rbind, all_precip_data)
+ combined_fitted_values <- do.call(rbind, all_fitted_values)
combined_param_values <- do.call(rbind, all_param_values)
- utils::write.csv(combined_param_values, file = file.path(PATHS$MODEL_INPUT, "combined_param_values.csv"), row.names = FALSE)
- message("Parameter values saved.")
+
+ # Remove beta0 and p parameters
+ combined_param_values <- combined_param_values[!(combined_param_values$parameter %in% c("beta0", "p")),]
+
+ path <- file.path(PATHS$MODEL_INPUT, "param_fourier_series.csv")
+ utils::write.csv(combined_param_values, file = path, row.names = FALSE)
+ message("Parameter values saved to:")
+ message(path)
+
+
+
+
+
+
+
+
+
}
diff --git a/R/fourier_series_double.R b/R/fourier_series_double.R
new file mode 100644
index 0000000..698c0b0
--- /dev/null
+++ b/R/fourier_series_double.R
@@ -0,0 +1,46 @@
+#' Fourier Series Model with Two Harmonics (Sine-Cosine Form)
+#'
+#' This function implements a generalized Fourier series model with two harmonics in the sine-cosine form. The model is often used to capture seasonal or periodic dynamics in time series data, such as temperature, precipitation, or disease cases.
+#'
+#' @param t A numeric vector representing time points (e.g., day of the year or week of the year).
+#' @param beta0 A numeric value representing the intercept term (fixed at 0 by default).
+#' @param a1 A numeric value representing the amplitude of the first cosine term (first harmonic).
+#' @param b1 A numeric value representing the amplitude of the first sine term (first harmonic).
+#' @param a2 A numeric value representing the amplitude of the second cosine term (second harmonic).
+#' @param b2 A numeric value representing the amplitude of the second sine term (second harmonic).
+#' @param p A numeric value representing the period of the seasonal cycle (e.g., 52 for weekly data over a year).
+#'
+#' @return A numeric vector of predicted values based on the Fourier series model.
+#'
+#' @details The model is defined as follows:
+#' \deqn{\beta_t = \beta_0 + a_1 \cos\left(\frac{2 \pi t}{p}\right) + b_1 \sin\left(\frac{2 \pi t}{p}\right) + a_2 \cos\left(\frac{4 \pi t}{p}\right) + b_2 \sin\left(\frac{4 \pi t}{p}\right)}
+#' The model includes an intercept term \code{beta0} (set to 0 by default) and two harmonics with coefficients \code{a1}, \code{b1}, \code{a2}, and \code{b2}. The period \code{p} controls the periodicity of the series.
+#'
+#' This function is based on the sine-cosine form of the Fourier series. For more details, see the Wikipedia page on [Fourier series](https://en.wikipedia.org/wiki/Fourier_series).
+#'
+#' This function is commonly used for modeling seasonal dynamics in environmental or epidemiological data, where periodic patterns are observed.
+#'
+#' @examples
+#' \dontrun{
+#' # Example usage with weekly data (p = 52 weeks in a year)
+#' time_points <- 1:52
+#' beta0 <- 0
+#' a1 <- 1.5
+#' b1 <- -0.5
+#' a2 <- 0.8
+#' b2 <- 0.3
+#' p <- 52
+#'
+#' predictions <- fourier_series_double(time_points, beta0, a1, b1, a2, b2, p)
+#' print(predictions)
+#' }
+#'
+#' @export
+
+fourier_series_double <- function(t, beta0, a1, b1, a2, b2, p) {
+ beta0 +
+ a1 * cos(2 * pi * t / p) +
+ b1 * sin(2 * pi * t / p) +
+ a2 * cos(4 * pi * t / p) +
+ b2 * sin(4 * pi * t / p)
+}
diff --git a/R/get_climate_future.R b/R/get_climate_future.R
index c151b79..67783f3 100644
--- a/R/get_climate_future.R
+++ b/R/get_climate_future.R
@@ -125,8 +125,8 @@ get_climate_future <- function(lat,
"https://customer-climate-api.open-meteo.com/v1/climate?",
"latitude=", lat[i],
"&longitude=", lon[i],
- "&date_start=", date_start,
- "&date_stop=", date_stop,
+ "&start_date=", date_start,
+ "&end_date=", date_stop,
"&models=", climate_model,
"&daily=", variables_param,
"&apikey=", api_key
diff --git a/R/get_climate_historical.R b/R/get_climate_historical.R
index 204ae6e..1f32f8b 100644
--- a/R/get_climate_historical.R
+++ b/R/get_climate_historical.R
@@ -97,7 +97,7 @@ get_climate_historical <- function(lat, lon, start_date, end_date, climate_varia
results_list[[variable]] <- data.frame(
date = as.Date(dates),
climate_variable = variable,
- climate_value = data$daily[[variable]]
+ value = data$daily[[variable]]
)
}
}
diff --git a/R/run_WHO_annual_data_app.R b/R/run_WHO_annual_data_app.R
index 67b98f0..ede53d5 100644
--- a/R/run_WHO_annual_data_app.R
+++ b/R/run_WHO_annual_data_app.R
@@ -13,7 +13,6 @@
#' @importFrom ggplot2 ggplot geom_bar geom_hline geom_vline geom_errorbar geom_point theme_minimal labs scale_y_sqrt scale_x_discrete theme element_text
#' @importFrom RColorBrewer brewer.pal
#' @importFrom grDevices adjustcolor
-#' @importFrom shinyWidgets shinyApp
#' @importFrom utils read.csv
#'
#' @examples
diff --git a/docs/_pkgdown.yml b/docs/_pkgdown.yml
index 8bd200e..e75e838 100644
--- a/docs/_pkgdown.yml
+++ b/docs/_pkgdown.yml
@@ -70,6 +70,7 @@ reference:
- title: "Estimating model quantities"
contents:
- est_seasonal_dynamics
+ - fourier_series_double
- est_mobility
- est_WASH_coverage
- est_symptomatic_prop
diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml
index 01272e7..7e0e766 100644
--- a/docs/pkgdown.yml
+++ b/docs/pkgdown.yml
@@ -4,7 +4,7 @@ pkgdown_sha: ~
articles:
Project-setup: Project-setup.html
Running-MOSAIC: Running-MOSAIC.html
-last_built: 2024-09-24T22:24Z
+last_built: 2024-09-25T19:41Z
urls:
reference: institutefordiseasemodeling.github.io/MOSAIC-pkg/reference
article: institutefordiseasemodeling.github.io/MOSAIC-pkg/articles
diff --git a/docs/reference/download_climate_data.html b/docs/reference/download_climate_data.html
index 630ddc6..0b4a8c1 100644
--- a/docs/reference/download_climate_data.html
+++ b/docs/reference/download_climate_data.html
@@ -1,5 +1,5 @@
-
Download and Save Climate Data for Multiple Countries (Parquet Format, Single Model) — download_climate_data • MOSAICDownload and Save Climate Data for Multiple Countries (Parquet Format, Multiple Models and Variables) — download_climate_data • MOSAICEstimate Seasonal Dynamics for Cholera and Precipitation Using Fourier Series — est_seasonal_dynamics • MOSAIC
+ Skip to contents
+
+
+
+
+
+
Fourier Series Model with Two Harmonics (Sine-Cosine Form)
+
+
fourier_series_double.Rd
+
+
+
+
This function implements a generalized Fourier series model with two harmonics in the sine-cosine form. The model is often used to capture seasonal or periodic dynamics in time series data, such as temperature, precipitation, or disease cases.
A numeric vector representing time points (e.g., day of the year or week of the year).
+
+
+
beta0
+
A numeric value representing the intercept term (fixed at 0 by default).
+
+
+
a1
+
A numeric value representing the amplitude of the first cosine term (first harmonic).
+
+
+
b1
+
A numeric value representing the amplitude of the first sine term (first harmonic).
+
+
+
a2
+
A numeric value representing the amplitude of the second cosine term (second harmonic).
+
+
+
b2
+
A numeric value representing the amplitude of the second sine term (second harmonic).
+
+
+
p
+
A numeric value representing the period of the seasonal cycle (e.g., 52 for weekly data over a year).
+
+
+
+
Value
+
+
+
A numeric vector of predicted values based on the Fourier series model.
+
+
+
Details
+
The model is defined as follows:
+$$\beta_t = \beta_0 + a_1 \cos\left(\frac{2 \pi t}{p}\right) + b_1 \sin\left(\frac{2 \pi t}{p}\right) + a_2 \cos\left(\frac{4 \pi t}{p}\right) + b_2 \sin\left(\frac{4 \pi t}{p}\right)$$
+The model includes an intercept term beta0 (set to 0 by default) and two harmonics with coefficients a1, b1, a2, and b2. The period p controls the periodicity of the series.
+
This function is based on the sine-cosine form of the Fourier series. For more details, see the Wikipedia page on Fourier series.
+
This function is commonly used for modeling seasonal dynamics in environmental or epidemiological data, where periodic patterns are observed.
+
+
+
+
Examples
+
if(FALSE){
+# Example usage with weekly data (p = 52 weeks in a year)
+time_points<-1:52
+beta0<-0
+a1<-1.5
+b1<--0.5
+a2<-0.8
+b2<-0.3
+p<-52
+
+predictions<-fourier_series_double(time_points, beta0, a1, b1, a2, b2, p)
+print(predictions)
+}
+
+
Fourier Series Model with Two Harmonics (Sine-Cosine Form)
est_mobility()
diff --git a/docs/search.json b/docs/search.json
index f1c44e6..8225420 100644
--- a/docs/search.json
+++ b/docs/search.json
@@ -1 +1 @@
-[{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/articles/Project-setup.html","id":"instructions-to-setup-a-mosaic-project-programmatically","dir":"Articles","previous_headings":"","what":"Instructions to setup a MOSAIC project programmatically","title":"Project setup","text":"following instructions guide setting MOSAIC project directory programmatically cloning necessary repositories using Bash script.","code":"#!/bin/bash # Set the MOSAIC parent directory MOSAIC_DIR=\"MOSAIC\" # Create the MOSAIC directory if it doesn't exist if [ ! -d \"$MOSAIC_DIR\" ]; then mkdir \"$MOSAIC_DIR\" echo \"Created directory: $MOSAIC_DIR\" fi # Change to the MOSAIC directory cd \"$MOSAIC_DIR\" # Clone the MOSAIC-data repository if [ ! -d \"MOSAIC-data\" ]; then git clone git@github.com:InstituteforDiseaseModeling/MOSAIC-data.git echo \"Cloned MOSAIC-data repository.\" else echo \"MOSAIC-data repository already exists.\" fi # Clone the MOSAIC-pkg repository if [ ! -d \"MOSAIC-pkg\" ]; then git clone git@github.com:InstituteforDiseaseModeling/MOSAIC-pkg.git echo \"Cloned MOSAIC-pkg repository.\" else echo \"MOSAIC-pkg repository already exists.\" fi # Clone the MOSAIC-docs repository if [ ! -d \"MOSAIC-docs\" ]; then git clone git@github.com:InstituteforDiseaseModeling/MOSAIC-docs.git echo \"Cloned MOSAIC-docs repository.\" else echo \"MOSAIC-docs repository already exists.\" fi echo \"MOSAIC project setup complete.\" #> Created directory: MOSAIC #> #> Cloning into 'MOSAIC-data'... #> Cloned MOSAIC-data repository. #> Cloning into 'MOSAIC-pkg'... #> Cloned MOSAIC-pkg repository. #> Cloning into 'MOSAIC-docs'... #> Cloned MOSAIC-docs repository. #> MOSAIC project setup complete."},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"John R Giles. Author, maintainer.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Giles J (2024). MOSAIC: Metapopulation Outbreak Simulation Interventions Cholera (MOSAIC). R package version 0.0.1.","code":"@Manual{, title = {MOSAIC: Metapopulation Outbreak Simulation And Interventions for Cholera (MOSAIC)}, author = {John R Giles}, year = {2024}, note = {R package version 0.0.1}, }"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/index.html","id":"mosaic-the-metapopulation-outbreak-simulation-with-agent-based-implementation-for-cholera-","dir":"","previous_headings":"","what":"Metapopulation Outbreak Simulation And Interventions for Cholera (MOSAIC)","title":"Metapopulation Outbreak Simulation And Interventions for Cholera (MOSAIC)","text":" Welcome R package MOSAIC framework. MOSAIC R package provides tools simulating cholera transmission dynamics using metapopulation models, estimating mobility patterns drivers transmission environmental forcing, visualizing disease dynamics outbreak projections. Note repo holds code data models , full documentation see: https://institutefordiseasemodeling.github.io/MOSAIC-docs/.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/index.html","id":"mosaic-project-directory-structure","dir":"","previous_headings":"","what":"MOSAIC Project Directory Structure","title":"Metapopulation Outbreak Simulation And Interventions for Cholera (MOSAIC)","text":"MOSAIC R package designed used within triad Github repos functions documented MOSAIC-pkg. package downloads processes required data saved MOSAIC-data prepares model quantities run MOSAIC saved MOSAIC-pkg/model/input. package also produces figures tables used make documentation located MOSAIC-docs. directory structure MOSAIC project. See ./src/mosiac_setup.sh project setup script.","code":"MOSAIC/ # Local parent directory to hold 3 repositories, root directory in get_paths() ├── MOSAIC-data/ │ ├── raw/ # Raw data files supplied to MOSAIC-pkg │ └── processed/ # Processed data files supplied to MOSAIC-pkg ├── MOSAIC-pkg/ │ ├── [R package] # Contents of MOSAIC R package: https://gilesjohnr.github.io/MOSAIC-pkg/ │ └── model/ │ ├── input/ # Files used as input to MOSAIC framework │ ├── output/ # Location of output from MOSAIC framework │ └── LAUNCH.R # LAUNCH.R file runs data acquisition functions, a priori models, and runs MOSAIC └── MOSAIC-docs/ ├── [Website] # Documentation and model description: https://gilesjohnr.github.io/MOSAIC-docs/ ├── figures/ # Output images and figures from MOSAIC-pkg used in documentation └── tables/ # Output data and parameter values from MOSAIC-pkg used in documentation"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/index.html","id":"contact","dir":"","previous_headings":"","what":"Contact","title":"Metapopulation Outbreak Simulation And Interventions for Cholera (MOSAIC)","text":"questions information MOSAIC project, please contact: John Giles: john.giles@gatesfoundation.org Jillian Gauld: jillian.gauld@gatesfoundation.org Rajiv Sodhi: rajiv.sodhi@gatesfoundation.org","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/compile_ENSO_data.html","id":null,"dir":"Reference","previous_headings":"","what":"Compile ENSO and DMI Data (Historical and Forecast) — compile_ENSO_data","title":"Compile ENSO and DMI Data (Historical and Forecast) — compile_ENSO_data","text":"function compiles historical forecast data DMI ENSO (Niño3, Niño3.4, Niño4) single data frame. data filtered include years specified year_start onwards. function also allows disaggregation monthly data daily weekly values using either linear interpolation spline interpolation.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/compile_ENSO_data.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Compile ENSO and DMI Data (Historical and Forecast) — compile_ENSO_data","text":"","code":"compile_ENSO_data(year_start = NULL, frequency = \"monthly\", method = \"linear\")"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/compile_ENSO_data.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Compile ENSO and DMI Data (Historical and Forecast) — compile_ENSO_data","text":"year_start integer representing start year filtering data. data year onward included compiled data. value must greater equal 1870. frequency character string specifying time resolution output data. Valid options \"daily\", \"weekly\", \"monthly\". method character string specifying interpolation method use. Valid options \"linear\" (linear interpolation using zoo::na.approx()) \"spline\" (spline interpolation using zoo::na.spline()).","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/compile_ENSO_data.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Compile ENSO and DMI Data (Historical and Forecast) — compile_ENSO_data","text":"data frame combined historical forecast data DMI, ENSO3, ENSO34, ENSO4. data frame includes following columns: date: date data (daily, weekly, monthly) YYYY-MM-DD format. variable: variable name, can \"DMI\", \"ENSO3\", \"ENSO34\", \"ENSO4\". value: value variable (sea surface temperature anomaly). year: year corresponding date. month: month corresponding date. week: week year (\"weekly\" \"daily\" frequency). doy: day year (\"daily\" frequency).","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/compile_ENSO_data.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Compile ENSO and DMI Data (Historical and Forecast) — compile_ENSO_data","text":"","code":"if (FALSE) { # Compile the ENSO and DMI data from the year 2000 onwards compiled_enso_data <- compile_ENSO_data(2010, \"monthly\") # Display the compiled data head(compiled_enso_data) }"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/convert_country_to_iso.html","id":null,"dir":"Reference","previous_headings":"","what":"Convert Country Names to ISO3 or ISO2 Country Codes — convert_country_to_iso","title":"Convert Country Names to ISO3 or ISO2 Country Codes — convert_country_to_iso","text":"function converts country names corresponding ISO3 ISO2 country codes. function uses countrycode package, allows multiple spellings variations country names.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/convert_country_to_iso.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Convert Country Names to ISO3 or ISO2 Country Codes — convert_country_to_iso","text":"","code":"convert_country_to_iso(x, iso3 = TRUE)"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/convert_country_to_iso.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Convert Country Names to ISO3 or ISO2 Country Codes — convert_country_to_iso","text":"x character vector country names (e.g., \"United States\", \"UK\", \"Democratic Republic Congo\"). iso3 logical value. TRUE (default), returns ISO3 country codes. FALSE, returns ISO2 country codes.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/convert_country_to_iso.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Convert Country Names to ISO3 or ISO2 Country Codes — convert_country_to_iso","text":"character vector ISO3 ISO2 country codes corresponding country names.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/convert_country_to_iso.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Convert Country Names to ISO3 or ISO2 Country Codes — convert_country_to_iso","text":"function converts country names ISO3 ISO2 codes using countrycode package. handles various common alternative spellings country names.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/convert_country_to_iso.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Convert Country Names to ISO3 or ISO2 Country Codes — convert_country_to_iso","text":"","code":"# Convert a single country name to ISO3 convert_country_to_iso(\"United States\") #> [1] \"USA\" # Convert a vector of country names to ISO2 convert_country_to_iso(c(\"United States\", \"UK\", \"Democratic Republic of Congo\"), iso3 = FALSE) #> [1] \"US\" \"GB\" \"CD\""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/convert_iso_codes.html","id":null,"dir":"Reference","previous_headings":"","what":"Convert ISO3 to ISO2 or ISO2 to ISO3 Country Codes — convert_iso_codes","title":"Convert ISO3 to ISO2 or ISO2 to ISO3 Country Codes — convert_iso_codes","text":"function converts vector scalar ISO3 country codes ISO2 country codes, vice versa, based input. function uses countrycode package auto-detects input format.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/convert_iso_codes.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Convert ISO3 to ISO2 or ISO2 to ISO3 Country Codes — convert_iso_codes","text":"","code":"convert_iso_codes(iso_codes)"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/convert_iso_codes.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Convert ISO3 to ISO2 or ISO2 to ISO3 Country Codes — convert_iso_codes","text":"iso_codes vector scalar ISO2 ISO3 country codes (e.g., \"USA\", \"GBR\", \"ZA\", \"GB\").","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/convert_iso_codes.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Convert ISO3 to ISO2 or ISO2 to ISO3 Country Codes — convert_iso_codes","text":"character vector converted ISO2 ISO3 country codes corresponding provided input.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/convert_iso_codes.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Convert ISO3 to ISO2 or ISO2 to ISO3 Country Codes — convert_iso_codes","text":"function detects whether input ISO2 ISO3 format based code length converts accordingly using countrycode package.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/convert_iso_codes.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Convert ISO3 to ISO2 or ISO2 to ISO3 Country Codes — convert_iso_codes","text":"","code":"# Convert a vector of ISO3 codes to ISO2 codes convert_iso_codes(c(\"USA\", \"GBR\", \"DZA\")) #> [1] \"US\" \"GB\" \"DZ\" # Convert a vector of ISO2 codes to ISO3 codes convert_iso_codes(c(\"US\", \"GB\", \"DZ\")) #> [1] \"USA\" \"GBR\" \"DZA\""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/convert_iso_to_country.html","id":null,"dir":"Reference","previous_headings":"","what":"Convert ISO2 or ISO3 Country Codes to Country Names — convert_iso_to_country","title":"Convert ISO2 or ISO3 Country Codes to Country Names — convert_iso_to_country","text":"function converts vector scalar ISO2 ISO3 country codes corresponding country names using countrycode package.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/convert_iso_to_country.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Convert ISO2 or ISO3 Country Codes to Country Names — convert_iso_to_country","text":"","code":"convert_iso_to_country(iso)"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/convert_iso_to_country.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Convert ISO2 or ISO3 Country Codes to Country Names — convert_iso_to_country","text":"iso vector scalar ISO2 ISO3 country codes (e.g., \"USA\", \"GB\", \"DZA\").","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/convert_iso_to_country.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Convert ISO2 or ISO3 Country Codes to Country Names — convert_iso_to_country","text":"character vector country names corresponding provided ISO2 ISO3 country codes.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/convert_iso_to_country.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Convert ISO2 or ISO3 Country Codes to Country Names — convert_iso_to_country","text":"function automatically detects input ISO2 ISO3 format returns corresponding country names. Special handling applied Congo Democratic Republic Congo.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/convert_iso_to_country.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Convert ISO2 or ISO3 Country Codes to Country Names — convert_iso_to_country","text":"","code":"# Convert a vector of ISO3 and ISO2 codes to country names convert_iso_to_country(c(\"USA\", \"GBR\", \"DZA\", \"COD\")) #> [1] \"United States\" \"United Kingdom\" #> [3] \"Algeria\" \"Democratic Republic of Congo\""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/download_africa_shapefile.html","id":null,"dir":"Reference","previous_headings":"","what":"Download and Save Africa Shapefile — download_africa_shapefile","title":"Download and Save Africa Shapefile — download_africa_shapefile","text":"function downloads shapefile African countries using rnaturalearth package saves specified directory. output directory exist, created.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/download_africa_shapefile.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Download and Save Africa Shapefile — download_africa_shapefile","text":"","code":"download_africa_shapefile(PATHS)"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/download_africa_shapefile.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Download and Save Africa Shapefile — download_africa_shapefile","text":"PATHS list environment containing path structure, PATHS$DATA_PROCESSED specifies directory save processed shapefile.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/download_africa_shapefile.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Download and Save Africa Shapefile — download_africa_shapefile","text":"message indicating shapefile saved, including full path saved file.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/download_africa_shapefile.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Download and Save Africa Shapefile — download_africa_shapefile","text":"function uses rnaturalearth package download shapefile African continent. shapefile saved AFRICA_ADM0.shp directory specified PATHS$DATA_PROCESSED/shapefiles. function create directory already exist.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/download_africa_shapefile.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Download and Save Africa Shapefile — download_africa_shapefile","text":"","code":"if (FALSE) { # Example PATHS object PATHS <- list(DATA_PROCESSED = \"path/to/processed/data\") # Download and save the Africa shapefile download_africa_shapefile(PATHS) }"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/download_all_country_shapefiles.html","id":null,"dir":"Reference","previous_headings":"","what":"Download and Save Shapefiles for All African Countries — download_all_country_shapefiles","title":"Download and Save Shapefiles for All African Countries — download_all_country_shapefiles","text":"function downloads shapefiles African country saves specified directory. function iterates ISO3 country codes Africa (MOSAIC framework) saves country's shapefile individually.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/download_all_country_shapefiles.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Download and Save Shapefiles for All African Countries — download_all_country_shapefiles","text":"","code":"download_all_country_shapefiles(PATHS)"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/download_all_country_shapefiles.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Download and Save Shapefiles for All African Countries — download_all_country_shapefiles","text":"PATHS list containing paths processed data saved. PATHS typically output get_paths() function include: DATA_PROCESSED: Path directory processed shapefiles saved.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/download_all_country_shapefiles.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Download and Save Shapefiles for All African Countries — download_all_country_shapefiles","text":"function return value. downloads shapefiles African country saves individual shapefiles processed data directory.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/download_all_country_shapefiles.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Download and Save Shapefiles for All African Countries — download_all_country_shapefiles","text":"function performs following steps: Creates output directory shapefiles exist. Loops list ISO3 country codes African countries. Downloads country's shapefile using MOSAIC::get_country_shp(). Saves shapefile processed data directory ISO3_ADM0.shp.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/download_all_country_shapefiles.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Download and Save Shapefiles for All African Countries — download_all_country_shapefiles","text":"","code":"if (FALSE) { # Define paths for processed data using get_paths() PATHS <- get_paths() # Download and save shapefiles for all African countries download_all_country_shapefiles(PATHS) }"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/download_climate_data.html","id":null,"dir":"Reference","previous_headings":"","what":"Download and Save Climate Data for Multiple Countries (Parquet Format, Single Model) — download_climate_data","title":"Download and Save Climate Data for Multiple Countries (Parquet Format, Single Model) — download_climate_data","text":"function downloads daily climate data list specified countries, saving data Parquet files. data includes historical future climate variables grid points within country specified climate model.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/download_climate_data.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Download and Save Climate Data for Multiple Countries (Parquet Format, Single Model) — download_climate_data","text":"","code":"download_climate_data( PATHS, iso_codes, n_points, date_start, date_stop, climate_model, api_key )"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/download_climate_data.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Download and Save Climate Data for Multiple Countries (Parquet Format, Single Model) — download_climate_data","text":"PATHS list containing paths raw processed data stored. PATHS typically output get_paths() function include: DATA_SHAPEFILES: Path directory containing country shapefiles. DATA_CLIMATE: Path directory processed climate data saved. iso_codes character vector ISO3 country codes climate data downloaded. n_points integer specifying number grid points generate within country climate data downloaded. date_start character string representing start date climate data (\"YYYY-MM-DD\" format). date_stop character string representing end date climate data (\"YYYY-MM-DD\" format). climate_model single character string representing climate model use. Available models include: CMCC_CM2_VHR4 FGOALS_f3_H HiRAM_SIT_HR MRI_AGCM3_2_S EC_Earth3P_HR MPI_ESM1_2_XR NICAM16_8S api_key character string representing API key required access climate data API.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/download_climate_data.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Download and Save Climate Data for Multiple Countries (Parquet Format, Single Model) — download_climate_data","text":"function return value. downloads climate data country saves results Parquet files specified directory.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/download_climate_data.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Download and Save Climate Data for Multiple Countries (Parquet Format, Single Model) — download_climate_data","text":"function uses country shapefiles generate grid points within country, climate data downloaded. function retrieves climate data specified date range (date_start date_stop) specified climate model. data saved country Parquet file named climate_data_{climate_model}_{date_start}_{date_stop}_{ISO3}.parquet. climate data variables include temperature, wind speed, cloud cover, precipitation, . function retrieves data single climate model.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/download_climate_data.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Download and Save Climate Data for Multiple Countries (Parquet Format, Single Model) — download_climate_data","text":"","code":"if (FALSE) { # Define paths for raw and processed data using get_paths() PATHS <- get_paths() # ISO3 country codes for African countries iso_codes <- c(\"ZAF\", \"KEN\", \"NGA\") # API key for climate data API api_key <- \"your-api-key-here\" # Download climate data for a specified model and save it for the specified countries download_climate_data(PATHS, iso_codes, n_points = 5, date_start = \"1970-01-01\", date_stop = \"2030-12-31\", climate_model = \"MRI_AGCM3_2_S\", api_key) }"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/download_country_DEM.html","id":null,"dir":"Reference","previous_headings":"","what":"Download 1km DEM Raster for Multiple Countries and Save to Files — download_country_DEM","title":"Download 1km DEM Raster for Multiple Countries and Save to Files — download_country_DEM","text":"function downloads 1km resolution DEM (Digital Elevation Model) raster data given vector ISO3 country codes, writes raster GeoTIFF file.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/download_country_DEM.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Download 1km DEM Raster for Multiple Countries and Save to Files — download_country_DEM","text":"","code":"download_country_DEM(PATHS, iso_codes, zoom_level = 6)"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/download_country_DEM.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Download 1km DEM Raster for Multiple Countries and Save to Files — download_country_DEM","text":"PATHS list containing paths DEM data saved. Typically generated get_paths() function include: DATA_DEM: Path directory DEM rasters saved. #' @param iso_codes character vector ISO3 country codes DEM data downloaded. zoom_level integer representing zoom level DEM data. Zoom levels 6-8 recommended 1km resolution (default = 6).","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/download_country_DEM.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Download 1km DEM Raster for Multiple Countries and Save to Files — download_country_DEM","text":"function return value. downloads DEM data country saves results GeoTIFF files specified directory.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/download_country_DEM.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Download 1km DEM Raster for Multiple Countries and Save to Files — download_country_DEM","text":"","code":"if (FALSE) { # Define the ISO3 country codes iso_codes <- c(\"ZAF\", \"KEN\", \"NGA\") # Get paths for data storage PATHS <- get_paths() # Download DEM rasters for the countries download_country_DEM(iso_codes, PATHS) }"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/est_WASH_coverage.html","id":null,"dir":"Reference","previous_headings":"","what":"Estimate and Visualize WASH Coverage and Correlation with Cholera Incidence — est_WASH_coverage","title":"Estimate and Visualize WASH Coverage and Correlation with Cholera Incidence — est_WASH_coverage","text":"function processes Water, Sanitation, Hygiene (WASH) coverage data African countries, optimizes weights WASH variables, calculates weighted means, examines correlation cholera incidence. function generates plots tables showing relationships saves results specified paths.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/est_WASH_coverage.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Estimate and Visualize WASH Coverage and Correlation with Cholera Incidence — est_WASH_coverage","text":"","code":"est_WASH_coverage(PATHS)"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/est_WASH_coverage.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Estimate and Visualize WASH Coverage and Correlation with Cholera Incidence — est_WASH_coverage","text":"PATHS list containing paths WASH data, figures, model inputs saved. Typically generated get_paths() function include: DATA_WASH: Path WASH data CSV file. DOCS_FIGURES: Path save output figures. MODEL_INPUT: Path save model input data. DOCS_TABLES: Path save tables used documentation.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/est_WASH_coverage.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Estimate and Visualize WASH Coverage and Correlation with Cholera Incidence — est_WASH_coverage","text":"function return value, generates saves plots CSV files showing WASH coverage estimates, optimized weights WASH variables, correlation cholera incidence.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/est_WASH_coverage.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Estimate and Visualize WASH Coverage and Correlation with Cholera Incidence — est_WASH_coverage","text":"WASH coverage data first normalized (0-1 scale). Risk-related WASH variables (unimproved water sources, surface water, unimproved sanitation, open defecation) converted protective factors taking complement (1 - value). , function: Optimizes weights WASH variable maximize correlation cholera incidence using L-BFGS-B method. Calculates weighted mean WASH variables country. Generates multiple plots showing relationships WASH variables cholera incidence. Saves tables optimized weights weighted mean WASH indices. Data Source: Sikder et al. (2023). Water, Sanitation, Hygiene Coverage Cholera Incidence Sub-Saharan Africa. doi:10.1021/acs.est.3c01317 .","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/est_WASH_coverage.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Estimate and Visualize WASH Coverage and Correlation with Cholera Incidence — est_WASH_coverage","text":"","code":"if (FALSE) { # Define paths for saving WASH data, figures, and tables PATHS <- get_paths() # Estimate WASH coverage and correlation with cholera incidence est_WASH_coverage(PATHS) }"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/est_immune_decay.html","id":null,"dir":"Reference","previous_headings":"","what":"Estimate Immune Decay — est_immune_decay","title":"Estimate Immune Decay — est_immune_decay","text":"function estimates immune durability fitting proportional decay model data. uses nonlinear least squares fitting (NLS) estimate decay parameters generates plots predicted immune durability decay rate distributions.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/est_immune_decay.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Estimate Immune Decay — est_immune_decay","text":"","code":"est_immune_decay(PATHS)"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/est_immune_decay.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Estimate Immune Decay — est_immune_decay","text":"PATHS list containing paths data figures saved. Typically generated get_paths() function include: DATA_IMMUNE_DURABILITY: Path directory containing immune durability data. DOCS_FIGURES: Path directory plots saved.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/est_immune_decay.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Estimate Immune Decay — est_immune_decay","text":"","code":"if (FALSE) { # Assuming PATHS is generated from get_paths() PATHS <- get_paths() est_immune_decay(PATHS) }"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/est_mobility.html","id":null,"dir":"Reference","previous_headings":"","what":"Fit Mobility Model Using Flight Data and Distance Matrices — est_mobility","title":"Fit Mobility Model Using Flight Data and Distance Matrices — est_mobility","text":"function estimates departure probability (tau_i) diffusion model (pi_ij) using flight data, distance matrices, population sizes. processes flight data, builds mobility distance matrices, fits mobility model, saves results CSV format.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/est_mobility.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Fit Mobility Model Using Flight Data and Distance Matrices — est_mobility","text":"","code":"est_mobility(PATHS)"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/est_mobility.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Fit Mobility Model Using Flight Data and Distance Matrices — est_mobility","text":"PATHS list containing paths data, models, figures stored. Typically generated get_paths() function include: DATA_OAG: Path directory containing flight data (OAG). DATA_SHAPEFILES: Path directory containing shapefiles African countries. DATA_DEMOGRAPHICS: Path directory containing demographic data. MODEL_INPUT: Path directory model input files saved. DOCS_FIGURES: Path directory figures saved.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/est_mobility.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Fit Mobility Model Using Flight Data and Distance Matrices — est_mobility","text":"function saves mobility matrices (M, D, N), travel probabilities (tau_j), diffusion matrices (pi_ij) CSV files specified directory. also generates saves visualizations PNG files.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/est_seasonal_dynamics.html","id":null,"dir":"Reference","previous_headings":"","what":"Get Seasonal Dynamics Data for Cholera and Precipitation — est_seasonal_dynamics","title":"Get Seasonal Dynamics Data for Cholera and Precipitation — est_seasonal_dynamics","text":"function retrieves historical precipitation data, processes cholera case data, fits seasonal dynamics models using Fourier series, saves results CSV file.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/est_seasonal_dynamics.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get Seasonal Dynamics Data for Cholera and Precipitation — est_seasonal_dynamics","text":"","code":"est_seasonal_dynamics(PATHS)"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/est_seasonal_dynamics.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get Seasonal Dynamics Data for Cholera and Precipitation — est_seasonal_dynamics","text":"PATHS list containing paths raw processed data stored. Typically generated get_paths() function.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/est_seasonal_dynamics.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get Seasonal Dynamics Data for Cholera and Precipitation — est_seasonal_dynamics","text":"function saves parameter estimates, fitted values, processed data CSV files.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/est_symptomatic_prop.html","id":null,"dir":"Reference","previous_headings":"","what":"Estimate and Visualize Symptomatic Proportion Data — est_symptomatic_prop","title":"Estimate and Visualize Symptomatic Proportion Data — est_symptomatic_prop","text":"function reads symptomatic proportion data, fits Beta distribution simulate proportion infections symptomatic, generates visualizations comparing estimates previous studies.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/est_symptomatic_prop.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Estimate and Visualize Symptomatic Proportion Data — est_symptomatic_prop","text":"","code":"est_symptomatic_prop(PATHS)"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/est_symptomatic_prop.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Estimate and Visualize Symptomatic Proportion Data — est_symptomatic_prop","text":"PATHS list containing paths symptomatic proportion data figures saved. Typically generated get_paths() function include: DATA_PROCESSED: Path symptomatic proportion data. DOCS_FIGURES: Path save generated plots.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/est_symptomatic_prop.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Estimate and Visualize Symptomatic Proportion Data — est_symptomatic_prop","text":"function return value generates saves plots PNG file.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/est_symptomatic_prop.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Estimate and Visualize Symptomatic Proportion Data — est_symptomatic_prop","text":"","code":"if (FALSE) { # Estimate and visualize symptomatic proportion data PATHS <- get_paths() est_symptomatic_prop(PATHS) }"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/est_vaccine_effectiveness.html","id":null,"dir":"Reference","previous_headings":"","what":"Estimate Vaccine Effectiveness Decay Model — est_vaccine_effectiveness","title":"Estimate Vaccine Effectiveness Decay Model — est_vaccine_effectiveness","text":"function fits proportional decay model vaccine effectiveness data estimates parameters model, saving results CSV files. model assumes vaccine effectiveness decays time according proportional decay function. Additionally, fits beta distribution initial vaccine effectiveness capture uncertainty estimate.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/est_vaccine_effectiveness.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Estimate Vaccine Effectiveness Decay Model — est_vaccine_effectiveness","text":"","code":"est_vaccine_effectiveness(PATHS)"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/est_vaccine_effectiveness.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Estimate Vaccine Effectiveness Decay Model — est_vaccine_effectiveness","text":"PATHS list containing paths parameter data predictions saved. Typically generated get_paths() function include: MODEL_INPUT: Path directory parameter estimates predictions saved. DATA_VACCINE_EFFECTIVENESS: Path directory vaccine effectiveness data located.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/est_vaccine_effectiveness.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Estimate Vaccine Effectiveness Decay Model — est_vaccine_effectiveness","text":"function return values saves following CSV files: param_vaccine_effectiveness.csv: Parameter estimates initial vaccine effectiveness decay rate, including beta distribution parameters uncertainty. pred_vaccine_effectiveness.csv: Predicted vaccine effectiveness time (days vaccination).","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/est_vaccine_effectiveness.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Estimate Vaccine Effectiveness Decay Model — est_vaccine_effectiveness","text":"function uses non-linear least squares (NLS) approach, specifically Levenberg-Marquardt algorithm nls.lm function minpack.lm package, fit vaccine effectiveness decay model. model defined two parameters: \\(\\phi\\): Initial vaccine effectiveness time zero. \\(\\omega\\): Decay rate vaccine effectiveness time. standard errors parameter estimates extracted covariance matrix fitted model. Confidence intervals initial vaccine effectiveness used fit beta distribution capture uncertainty estimate. fitting model, function generates prediction vaccine effectiveness time saves predictions, along parameter estimates beta distribution parameters, CSV files specified MODEL_INPUT directory.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/est_vaccine_effectiveness.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Estimate Vaccine Effectiveness Decay Model — est_vaccine_effectiveness","text":"","code":"if (FALSE) { # Assuming PATHS is generated from get_paths() PATHS <- get_paths() # Estimate vaccine effectiveness and save results est_vaccine_effectiveness(PATHS) }"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/generate_country_grid_dist.html","id":null,"dir":"Reference","previous_headings":"","what":"Generate a Grid of Points Within a Country's Shapefile Based on Distance — generate_country_grid_dist","title":"Generate a Grid of Points Within a Country's Shapefile Based on Distance — generate_country_grid_dist","text":"function generates grid points within country's shapefile, points spaced specified distance kilometers.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/generate_country_grid_dist.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Generate a Grid of Points Within a Country's Shapefile Based on Distance — generate_country_grid_dist","text":"","code":"generate_country_grid_dist(country_shp, distance_km)"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/generate_country_grid_dist.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Generate a Grid of Points Within a Country's Shapefile Based on Distance — generate_country_grid_dist","text":"country_shp sf object representing country's shapefile. distance_km numeric value specifying distance (kilometers) grid points.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/generate_country_grid_dist.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Generate a Grid of Points Within a Country's Shapefile Based on Distance — generate_country_grid_dist","text":"sf object containing generated grid points within country boundary.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/generate_country_grid_dist.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Generate a Grid of Points Within a Country's Shapefile Based on Distance — generate_country_grid_dist","text":"function creates regular grid points within polygon defined country's shapefile, spaced according specified distance kilometers.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/generate_country_grid_dist.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Generate a Grid of Points Within a Country's Shapefile Based on Distance — generate_country_grid_dist","text":"","code":"if (FALSE) { # Example usage with distance in kilometers grid_points_sf <- generate_country_grid_dist(country_shapefile, distance_km = 50) }"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/generate_country_grid_n.html","id":null,"dir":"Reference","previous_headings":"","what":"Generate a Grid of Points Within a Country's Shapefile Based on Number of Points — generate_country_grid_n","title":"Generate a Grid of Points Within a Country's Shapefile Based on Number of Points — generate_country_grid_n","text":"function generates grid points within country's shapefile, grid contains specified number evenly spaced points.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/generate_country_grid_n.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Generate a Grid of Points Within a Country's Shapefile Based on Number of Points — generate_country_grid_n","text":"","code":"generate_country_grid_n(country_shp, n_points)"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/generate_country_grid_n.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Generate a Grid of Points Within a Country's Shapefile Based on Number of Points — generate_country_grid_n","text":"country_shp sf object representing country's shapefile. n_points numeric value specifying total number evenly spaced points generate within country boundary.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/generate_country_grid_n.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Generate a Grid of Points Within a Country's Shapefile Based on Number of Points — generate_country_grid_n","text":"sf object containing generated grid points within country boundary.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/generate_country_grid_n.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Generate a Grid of Points Within a Country's Shapefile Based on Number of Points — generate_country_grid_n","text":"function creates regular grid points within polygon defined country's shapefile, containing specified number points.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/generate_country_grid_n.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Generate a Grid of Points Within a Country's Shapefile Based on Number of Points — generate_country_grid_n","text":"","code":"if (FALSE) { # Example usage with a specified number of points grid_points_sf <- generate_country_grid_n(country_shapefile, n_points = 100) }"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_DMI_forecast.html","id":null,"dir":"Reference","previous_headings":"","what":"Get DMI (Dipole Mode Index) Forecast Data — get_DMI_forecast","title":"Get DMI (Dipole Mode Index) Forecast Data — get_DMI_forecast","text":"function retrieves manually extracted Dipole Mode Index (DMI) forecast data Bureau Meteorology's IOD forecast page.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_DMI_forecast.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get DMI (Dipole Mode Index) Forecast Data — get_DMI_forecast","text":"","code":"get_DMI_forecast()"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_DMI_forecast.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get DMI (Dipole Mode Index) Forecast Data — get_DMI_forecast","text":"data frame columns year, month (numeric), month_name, variable (DMI), value. DMI measure difference sea surface temperature anomalies western eastern Indian Ocean used describe Indian Ocean Dipole (IOD).","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_DMI_forecast.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Get DMI (Dipole Mode Index) Forecast Data — get_DMI_forecast","text":"IOD forecast manually extracted Bureau Meteorology's IOD forecast page: http://www.bom.gov.au/climate/ocean/outlooks/#region=IOD. data includes DMI values series months years, representing forecasts sea surface temperature anomalies. Negative DMI values indicate cooler waters west, positive DMI values indicate warmer waters west Indian Ocean.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_DMI_forecast.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get DMI (Dipole Mode Index) Forecast Data — get_DMI_forecast","text":"","code":"if (FALSE) { # Get the DMI forecast data dmi_forecast <- get_DMI_forecast() # Display the DMI forecast data print(dmi_forecast) }"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_DMI_historical.html","id":null,"dir":"Reference","previous_headings":"","what":"Download and Process Historical DMI Data — get_DMI_historical","title":"Download and Process Historical DMI Data — get_DMI_historical","text":"function downloads historical Dipole Mode Index (DMI) data NOAA processes data frame columns year, month (1-12), month_name, variable (DMI), value.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_DMI_historical.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Download and Process Historical DMI Data — get_DMI_historical","text":"","code":"get_DMI_historical()"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_DMI_historical.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Download and Process Historical DMI Data — get_DMI_historical","text":"data frame columns year, month, month_name, variable (DMI), value.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_DMI_historical.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Download and Process Historical DMI Data — get_DMI_historical","text":"DMI data downloaded NOAA's historical DMI data page: https://psl.noaa.gov/gcos_wgsp/Timeseries/Data/dmi..long.data. data includes DMI values representing difference sea surface temperature anomalies western eastern Indian Ocean.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_DMI_historical.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Download and Process Historical DMI Data — get_DMI_historical","text":"","code":"if (FALSE) { # Get the historical DMI data dmi_historical <- get_DMI_historical() # Display the historical DMI data print(dmi_historical) }"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_ENSO_forecast.html","id":null,"dir":"Reference","previous_headings":"","what":"Get ENSO (Niño3, Niño3.4, and Niño4) Forecast Data — get_ENSO_forecast","title":"Get ENSO (Niño3, Niño3.4, and Niño4) Forecast Data — get_ENSO_forecast","text":"function retrieves manually extracted ENSO forecast data, including Niño3, Niño3.4, Niño4 sea surface temperature (SST) anomalies, Bureau Meteorology.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_ENSO_forecast.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get ENSO (Niño3, Niño3.4, and Niño4) Forecast Data — get_ENSO_forecast","text":"","code":"get_ENSO_forecast()"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_ENSO_forecast.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get ENSO (Niño3, Niño3.4, and Niño4) Forecast Data — get_ENSO_forecast","text":"data frame columns year, month (numeric), month_name, variable (ENSO3, ENSO34, ENSO4), value.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_ENSO_forecast.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Get ENSO (Niño3, Niño3.4, and Niño4) Forecast Data — get_ENSO_forecast","text":"ENSO forecast manually extracted Bureau Meteorology's ocean outlook page. data includes SST anomalies Niño3, Niño3.4, Niño4 regions. Negative values indicate cooler sea surface temperatures, positive values indicate warmer temperatures.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_ENSO_forecast.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get ENSO (Niño3, Niño3.4, and Niño4) Forecast Data — get_ENSO_forecast","text":"","code":"if (FALSE) { # Get the ENSO forecast data enso_forecast <- get_ENSO_forecast() # Display the ENSO forecast data print(enso_forecast) }"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_ENSO_historical.html","id":null,"dir":"Reference","previous_headings":"","what":"Download and Process Historical ENSO Data (Niño3, Niño3.4, Niño4) — get_ENSO_historical","title":"Download and Process Historical ENSO Data (Niño3, Niño3.4, Niño4) — get_ENSO_historical","text":"function downloads historical ENSO data Niño3, Niño3.4, Niño4 NOAA processes single data frame columns year (integer), month, month_name, variable (ENSO3, ENSO34, ENSO4), value.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_ENSO_historical.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Download and Process Historical ENSO Data (Niño3, Niño3.4, Niño4) — get_ENSO_historical","text":"","code":"get_ENSO_historical()"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_ENSO_historical.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Download and Process Historical ENSO Data (Niño3, Niño3.4, Niño4) — get_ENSO_historical","text":"data frame columns year, month, month_name, variable, value.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_ENSO_historical.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Download and Process Historical ENSO Data (Niño3, Niño3.4, Niño4) — get_ENSO_historical","text":"historical ENSO data downloaded NOAA's historical ENSO data pages. data includes sea surface temperature anomalies Niño3, Niño3.4, Niño4 regions.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_ENSO_historical.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Download and Process Historical ENSO Data (Niño3, Niño3.4, Niño4) — get_ENSO_historical","text":"","code":"if (FALSE) { # Get the historical ENSO data enso_historical <- get_ENSO_historical() # Display the historical ENSO data print(enso_historical) }"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_WASH_data.html","id":null,"dir":"Reference","previous_headings":"","what":"Download, Process, and Save WASH Coverage Data — get_WASH_data","title":"Download, Process, and Save WASH Coverage Data — get_WASH_data","text":"function processes WASH (Water, Sanitation, Hygiene) coverage data African countries Sikder et al. (2023). data includes indicators water sanitation access, including piped water, improved sanitation, unimproved water sources, open defecation. processed data saved CSV file specified path.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_WASH_data.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Download, Process, and Save WASH Coverage Data — get_WASH_data","text":"","code":"get_WASH_data(PATHS)"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_WASH_data.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Download, Process, and Save WASH Coverage Data — get_WASH_data","text":"PATHS list containing paths WASH data saved. Typically generated get_paths() function include: DATA_WASH: Path directory processed WASH data saved.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_WASH_data.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Download, Process, and Save WASH Coverage Data — get_WASH_data","text":"function return value processes WASH coverage data saves specified directory CSV file.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_WASH_data.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Download, Process, and Save WASH Coverage Data — get_WASH_data","text":"WASH coverage data based percentages population access piped water, improved water sources, septic sewer sanitation, improved sanitation. data also includes proportions population using unimproved water sources, surface water, unimproved sanitation, practicing open defecation. risk-related variables (unimproved water, surface water, unimproved sanitation, open defecation) converted complement (1 - value) reflect protective factors. data scaled 0 1. Data Source: Sikder et al. (2023). Water, Sanitation, Hygiene Coverage Cholera Incidence Sub-Saharan Africa. doi:10.1021/acs.est.3c01317 .","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_WASH_data.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Download, Process, and Save WASH Coverage Data — get_WASH_data","text":"","code":"if (FALSE) { # Define paths for saving WASH data PATHS <- get_paths() # Download, process, and save WASH coverage data get_WASH_data(PATHS) }"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_centroid.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate the Centroid of a Country from its Shapefile — get_centroid","title":"Calculate the Centroid of a Country from its Shapefile — get_centroid","text":"function reads country shapefile, calculates centroid, returns centroid coordinates (longitude latitude) along ISO3 country code.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_centroid.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate the Centroid of a Country from its Shapefile — get_centroid","text":"","code":"get_centroid(shapefile)"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_centroid.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate the Centroid of a Country from its Shapefile — get_centroid","text":"shapefile character string representing file path country shapefile (.shp format).","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_centroid.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculate the Centroid of a Country from its Shapefile — get_centroid","text":"data frame following columns: iso3: ISO3 country code extracted shapefile name. lon: longitude country's centroid. lat: latitude country's centroid.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_centroid.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Calculate the Centroid of a Country from its Shapefile — get_centroid","text":"function reads shapefile using sf::st_read(), calculates centroid country using sf::st_centroid(), extracts coordinates centroid sf::st_coordinates(). ISO3 code extracted filename shapefile, assuming first three characters shapefile name represent ISO3 country code.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_centroid.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Calculate the Centroid of a Country from its Shapefile — get_centroid","text":"","code":"if (FALSE) { # Example usage: # Assuming you have a shapefile \"ZAF_ADM0.shp\" for South Africa shapefile_path <- \"path/to/shapefile/ZAF_ADM0.shp\" centroid_data <- get_centroid(shapefile_path) print(centroid_data) }"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_climate_forecast.html","id":null,"dir":"Reference","previous_headings":"","what":"Get Climate Forecast Data (Daily) — get_climate_forecast","title":"Get Climate Forecast Data (Daily) — get_climate_forecast","text":"function retrieves daily climate forecast data specified location one climate variables range forecast days using Open-Meteo API.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_climate_forecast.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get Climate Forecast Data (Daily) — get_climate_forecast","text":"","code":"get_climate_forecast(lat, lon, n_days, climate_variables, api_key = NULL)"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_climate_forecast.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get Climate Forecast Data (Daily) — get_climate_forecast","text":"lat numeric value representing latitude location. lon numeric value representing longitude location. n_days integer representing number forecast days retrieve (maximum value 15). climate_variables character vector climate variables retrieve (e.g., c(\"temperature_2m_max\", \"precipitation_sum\")). api_key character string representing API key Open-Meteo API.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_climate_forecast.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get Climate Forecast Data (Daily) — get_climate_forecast","text":"data frame columns: date date forecast (class Date). climate_variable name climate variable. climate_value value climate variable date.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_climate_forecast.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Get Climate Forecast Data (Daily) — get_climate_forecast","text":"function queries Open-Meteo API daily weather forecast data specified latitude, longitude, range forecast days (15 days). API request successful, function returns data frame containing date, climate variable, value. request fails, function returns NULL issues warning HTTP status code.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_climate_forecast.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get Climate Forecast Data (Daily) — get_climate_forecast","text":"","code":"if (FALSE) { # Example usage to get forecast data for multiple climate variables lat <- 52.52 lon <- 13.41 n_days <- 15 climate_variables <- c(\"temperature_2m_max\", \"precipitation_sum\") api_key <- \"your_api_key_here\" forecast_data <- get_climate_forecast(lat, lon, n_days, climate_variables, api_key) print(forecast_data) }"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_climate_future.html","id":null,"dir":"Reference","previous_headings":"","what":"Download Future Climate Data for Multiple Locations (One Model at a Time) — get_climate_future","title":"Download Future Climate Data for Multiple Locations (One Model at a Time) — get_climate_future","text":"function retrieves daily future climate data multiple specified locations climate variables specified date range using specified climate model.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_climate_future.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Download Future Climate Data for Multiple Locations (One Model at a Time) — get_climate_future","text":"","code":"get_climate_future( lat, lon, date_start, date_stop, climate_variables, climate_model, api_key = NULL )"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_climate_future.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Download Future Climate Data for Multiple Locations (One Model at a Time) — get_climate_future","text":"lat numeric vector representing latitudes locations. lon numeric vector representing longitudes locations. date_start character string representing start date data \"YYYY-MM-DD\" format. date_stop character string representing end date data \"YYYY-MM-DD\" format. climate_variables character vector climate variables retrieve. Valid options include: temperature_2m_mean: Mean 2m air temperature. temperature_2m_max: Maximum 2m air temperature. temperature_2m_min: Minimum 2m air temperature. wind_speed_10m_mean: Mean 10m wind speed. wind_speed_10m_max: Maximum 10m wind speed. cloud_cover_mean: Mean cloud cover. shortwave_radiation_sum: Sum shortwave radiation. relative_humidity_2m_mean: Mean 2m relative humidity. relative_humidity_2m_max: Maximum 2m relative humidity. relative_humidity_2m_min: Minimum 2m relative humidity. dew_point_2m_mean: Mean 2m dew point temperature. dew_point_2m_min: Minimum 2m dew point temperature. dew_point_2m_max: Maximum 2m dew point temperature. precipitation_sum: Total precipitation. rain_sum: Total rainfall. snowfall_sum: Total snowfall. pressure_msl_mean: Mean sea level pressure. soil_moisture_0_to_10cm_mean: Mean soil moisture (0-10 cm depth). et0_fao_evapotranspiration_sum: Sum evapotranspiration (FAO standard). climate_model single character string representing climate model use. Available models include: CMCC_CM2_VHR4 FGOALS_f3_H HiRAM_SIT_HR MRI_AGCM3_2_S EC_Earth3P_HR MPI_ESM1_2_XR NICAM16_8S api_key character string representing API key climate data API. provided, function assumes API key required.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_climate_future.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Download Future Climate Data for Multiple Locations (One Model at a Time) — get_climate_future","text":"data frame columns: date: date climate data. latitude: latitude location. longitude: longitude location. climate_model: climate model used data. variable_name: climate variable retrieved (e.g., temperature_2m_mean, precipitation_sum). value: value climate variable date.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_climate_future.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Download Future Climate Data for Multiple Locations (One Model at a Time) — get_climate_future","text":"function retrieves daily future climate data multiple specified locations using Open-Meteo Climate API. downloads specified climate variables latitude longitude provided, using single climate model. data retrieved date range specified date_start date_stop. progress bar displayed indicate download progress.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_climate_future.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Download Future Climate Data for Multiple Locations (One Model at a Time) — get_climate_future","text":"","code":"if (FALSE) { # Define latitudes and longitudes for the locations lat <- c(40.7128, 34.0522) lon <- c(-74.0060, -118.2437) # Define the climate variables and model climate_vars <- c(\"temperature_2m_mean\", \"precipitation_sum\") climate_model <- \"MRI_AGCM3_2_S\" # Set the date range and API key date_start <- \"2023-01-01\" date_stop <- \"2030-12-31\" api_key <- \"your_api_key_here\" # Download the climate data climate_data <- get_climate_future(lat, lon, date_start, date_stop, climate_vars, climate_model, api_key) # Display the climate data head(climate_data) }"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_climate_historical.html","id":null,"dir":"Reference","previous_headings":"","what":"Get Historical Climate Data — get_climate_historical","title":"Get Historical Climate Data — get_climate_historical","text":"function retrieves historical weather data specified location one climate variables date range. uses Open-Meteo API.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_climate_historical.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get Historical Climate Data — get_climate_historical","text":"","code":"get_climate_historical( lat, lon, start_date, end_date, climate_variables, api_key = NULL )"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_climate_historical.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get Historical Climate Data — get_climate_historical","text":"lat numeric value representing latitude location. lon numeric value representing longitude location. start_date character string representing start date \"YYYY-MM-DD\" format. end_date character string representing end date \"YYYY-MM-DD\" format. climate_variables character vector climate variables retrieve (e.g., c(\"precipitation_sum\", \"temperature_2m_max\")). api_key character string representing API key Open-Meteo API. provided, default key used.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_climate_historical.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get Historical Climate Data — get_climate_historical","text":"data frame columns: date date observation (class Date). climate_variable name climate variable. climate_value value climate variable date.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_climate_historical.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Get Historical Climate Data — get_climate_historical","text":"function queries Open-Meteo API historical weather data given latitude, longitude, climate variables specified date range. API request successful, function returns data frame containing date, climate variable, value. request fails, function returns NULL issues warning HTTP status code.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_climate_historical.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get Historical Climate Data — get_climate_historical","text":"","code":"if (FALSE) { # Example usage to get historical data for multiple climate variables lat <- 40.7128 lon <- -74.0060 start_date <- \"2020-01-01\" end_date <- \"2020-12-31\" climate_variables <- c(\"temperature_2m_max\", \"precipitation_sum\") api_key <- \"your_api_key_here\" # Replace with your actual API key climate_data <- get_climate_historical(lat, lon, start_date, end_date, climate_variables, api_key) print(climate_data) }"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_country_shp.html","id":null,"dir":"Reference","previous_headings":"","what":"Get a country shapefile from GeoBoundaries API — get_country_shp","title":"Get a country shapefile from GeoBoundaries API — get_country_shp","text":"function retrieves shapefile given iso3 code GeoBoundaries data API.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_country_shp.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get a country shapefile from GeoBoundaries API — get_country_shp","text":"","code":"get_country_shp(iso3, path_output = NULL)"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_country_shp.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get a country shapefile from GeoBoundaries API — get_country_shp","text":"iso3 three-letter capitalized character string. Must follow ISO-3166 Alpha-3 country code standard (https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3). path_output file path save country shapefile","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_country_shp.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get a country shapefile from GeoBoundaries API — get_country_shp","text":"sf class shapefile","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_country_shp.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get a country shapefile from GeoBoundaries API — get_country_shp","text":"","code":"if (FALSE) { tmp <- get_country_shp(iso3 = 'MCO') plot(tmp) }"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_elevation.html","id":null,"dir":"Reference","previous_headings":"","what":"Get Mean or Median Elevation from Downloaded DEM Data Using Country Boundaries — get_elevation","title":"Get Mean or Median Elevation from Downloaded DEM Data Using Country Boundaries — get_elevation","text":"function calculates mean median elevation given set ISO3 country codes loading downloaded DEM files extracting raster values within country's boundary.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_elevation.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get Mean or Median Elevation from Downloaded DEM Data Using Country Boundaries — get_elevation","text":"","code":"get_elevation(PATHS, iso_codes, method = \"median\")"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_elevation.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get Mean or Median Elevation from Downloaded DEM Data Using Country Boundaries — get_elevation","text":"PATHS list containing paths DEM data stored. Typically generated get_paths() function include: DATA_DEM: Path directory DEM rasters saved (GeoTIFF format). DATA_SHAPEFILES: Path directory shapefiles saved. iso_codes character vector ISO3 country codes elevation data calculated. method character string specifying method use calculating elevation statistics. Can \"mean\" \"median\" (default \"median\").","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_elevation.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get Mean or Median Elevation from Downloaded DEM Data Using Country Boundaries — get_elevation","text":"data frame ISO3 codes, country names, calculated mean median elevation country.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_elevation.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get Mean or Median Elevation from Downloaded DEM Data Using Country Boundaries — get_elevation","text":"","code":"if (FALSE) { # Define the ISO3 country codes iso_codes <- c(\"ZAF\", \"KEN\", \"NGA\") # Get paths for data storage PATHS <- get_paths() # Calculate mean elevation for the countries mean_elevations <- get_elevation(iso_codes, PATHS, method = \"mean\") print(mean_elevations) }"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_generation_time_distribution.html","id":null,"dir":"Reference","previous_headings":"","what":"Estimate the Generation Time Distribution for Days and Weeks — get_generation_time_distribution","title":"Estimate the Generation Time Distribution for Days and Weeks — get_generation_time_distribution","text":"function generates probability distribution generation time cholera based gamma distribution. allows specification mean generation time, adjusts shape rate parameters. day-wise week-wise probabilities saved CSV files.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_generation_time_distribution.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Estimate the Generation Time Distribution for Days and Weeks — get_generation_time_distribution","text":"","code":"get_generation_time_distribution(PATHS, mean_generation_time)"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_generation_time_distribution.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Estimate the Generation Time Distribution for Days and Weeks — get_generation_time_distribution","text":"PATHS list containing paths output tables saved. Typically generated get_paths() function include: MODEL_INPUT: Path directory model input data saved. DOCS_TABLES: Path directory day-wise week-wise generation time tables saved. mean_generation_time numeric value representing desired mean generation time (days). value used adjust shape rate parameters gamma distribution.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_ggplot_legend.html","id":null,"dir":"Reference","previous_headings":"","what":"Extract the Legend from a ggplot Object — get_ggplot_legend","title":"Extract the Legend from a ggplot Object — get_ggplot_legend","text":"function extracts legend ggplot object returns grob (graphical object). extracted legend can used independently, instance, combine legend plots.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_ggplot_legend.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Extract the Legend from a ggplot Object — get_ggplot_legend","text":"","code":"get_ggplot_legend(plot)"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_ggplot_legend.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Extract the Legend from a ggplot Object — get_ggplot_legend","text":"plot ggplot object legend extracted.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_ggplot_legend.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Extract the Legend from a ggplot Object — get_ggplot_legend","text":"grob representing legend ggplot object.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_ggplot_legend.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Extract the Legend from a ggplot Object — get_ggplot_legend","text":"function converts ggplot object grob using ggplotGrob() extracts legend, stored grob name \"guide-box\". function can used separate legend plot combine plots needed.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_ggplot_legend.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Extract the Legend from a ggplot Object — get_ggplot_legend","text":"","code":"# Create a simple ggplot object p <- ggplot2::ggplot(mtcars, ggplot2::aes(x = wt, y = mpg, color = factor(gear))) + ggplot2::geom_point() + ggplot2::scale_color_discrete(name = \"Gear\") # Extract the legend from the plot legend <- get_ggplot_legend(p) # Display the extracted legend grid::grid.draw(legend)"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_immune_decay_data.html","id":null,"dir":"Reference","previous_headings":"","what":"Get Immune Decay Data — get_immune_decay_data","title":"Get Immune Decay Data — get_immune_decay_data","text":"function retrieves immune durability data based known values various studies. data includes time (days), effectiveness, confidence intervals studies.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_immune_decay_data.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get Immune Decay Data — get_immune_decay_data","text":"","code":"get_immune_decay_data(PATHS)"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_immune_decay_data.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get Immune Decay Data — get_immune_decay_data","text":"PATHS list containing paths data figures saved. Typically generated get_paths() function include: DATA_IMMUNE_DURABILITY: Path directory immune durability data saved.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_immune_decay_data.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get Immune Decay Data — get_immune_decay_data","text":"data frame columns: day, effectiveness, effectiveness_hi, effectiveness_lo, source.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_immune_decay_data.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get Immune Decay Data — get_immune_decay_data","text":"","code":"if (FALSE) { # Assuming PATHS is generated from get_paths() PATHS <- get_paths() immune_data <- get_immune_decay_data(PATHS) print(immune_data) }"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_paths.html","id":null,"dir":"Reference","previous_headings":"","what":"Generate Directory Paths for the MOSAIC Project — get_paths","title":"Generate Directory Paths for the MOSAIC Project — get_paths","text":"get_paths() function generates structured list file paths different data document directories MOSAIC project, based provided root directory.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_paths.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Generate Directory Paths for the MOSAIC Project — get_paths","text":"","code":"get_paths(root = NULL)"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_paths.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Generate Directory Paths for the MOSAIC Project — get_paths","text":"root string specifying root directory MOSAIC project. paths generated relative root.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_paths.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Generate Directory Paths for the MOSAIC Project — get_paths","text":"named list containing following paths: ROOT root directory provided user. DATA_RAW Path raw data directory (\"MOSAIC-data/data/raw\"). DATA_PROCESSED Path processed data directory (\"MOSAIC-data/data/processed\"). MODEL_INPUT NULL, reserved path model input (applicable). MODEL_OUTPUT NULL, reserved path model output (applicable). DOCS_FIGURES Path figures directory (\"MOSAIC-docs/figures\"). DOCS_TABLES Path tables directory (\"MOSAIC-docs/tables\"). DOCS_PARAMS Path parameters directory (\"MOSAIC-docs/parameters\").","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_paths.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Generate Directory Paths for the MOSAIC Project — get_paths","text":"function helps organize directory structure data document storage MOSAIC project generating paths raw data, processed data, figures, tables, parameters. paths returned named list can used streamline access various project-related directories.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_paths.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Generate Directory Paths for the MOSAIC Project — get_paths","text":"","code":"if (FALSE) { root_dir <- \"/{full file path}/MOSAIC\" PATHS <- get_paths(root_dir) print(PATHS$DATA_RAW) }"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_suspected_cases.html","id":null,"dir":"Reference","previous_headings":"","what":"Get Proportion of Suspected Cholera Cases and Save Parameter Data Frame — get_suspected_cases","title":"Get Proportion of Suspected Cholera Cases and Save Parameter Data Frame — get_suspected_cases","text":"function generates parameters proportion suspected cholera cases (rho) saves parameter data frame.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_suspected_cases.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get Proportion of Suspected Cholera Cases and Save Parameter Data Frame — get_suspected_cases","text":"","code":"get_suspected_cases(PATHS)"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_suspected_cases.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get Proportion of Suspected Cholera Cases and Save Parameter Data Frame — get_suspected_cases","text":"PATHS list containing paths parameter data saved. Typically generated get_paths() function include: MODEL_INPUT: Path directory parameter data frame saved.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_suspected_cases.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get Proportion of Suspected Cholera Cases and Save Parameter Data Frame — get_suspected_cases","text":"data frame containing parameter values proportion suspected cholera cases (rho).","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_symptomatic_prop_data.html","id":null,"dir":"Reference","previous_headings":"","what":"Get Symptomatic Proportion Data — get_symptomatic_prop_data","title":"Get Symptomatic Proportion Data — get_symptomatic_prop_data","text":"function creates data frame studies reporting proportion cholera infections symptomatic saves CSV file.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_symptomatic_prop_data.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get Symptomatic Proportion Data — get_symptomatic_prop_data","text":"","code":"get_symptomatic_prop_data(PATHS)"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_symptomatic_prop_data.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get Symptomatic Proportion Data — get_symptomatic_prop_data","text":"PATHS list containing paths symptomatic proportion data saved. Typically generated get_paths() function include: DATA_PROCESSED: Path save symptomatic proportion data.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_symptomatic_prop_data.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get Symptomatic Proportion Data — get_symptomatic_prop_data","text":"function return value saves data frame CSV file.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_symptomatic_prop_data.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get Symptomatic Proportion Data — get_symptomatic_prop_data","text":"","code":"if (FALSE) { # Generate and save symptomatic proportion data PATHS <- get_paths() get_symptomatic_prop_data(PATHS) }"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_vaccine_effectiveness_data.html","id":null,"dir":"Reference","previous_headings":"","what":"Get Vaccine Effectiveness Data — get_vaccine_effectiveness_data","title":"Get Vaccine Effectiveness Data — get_vaccine_effectiveness_data","text":"function saves dataset containing vaccine effectiveness data extracted multiple studies. data saved CSV file.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_vaccine_effectiveness_data.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get Vaccine Effectiveness Data — get_vaccine_effectiveness_data","text":"","code":"get_vaccine_effectiveness_data(PATHS)"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_vaccine_effectiveness_data.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get Vaccine Effectiveness Data — get_vaccine_effectiveness_data","text":"PATHS list containing paths data saved. Typically generated get_paths() function include: DATA_VACCINE_EFFECTIVENESS: Path directory vaccine effectiveness data saved.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/iso_codes_africa.html","id":null,"dir":"Reference","previous_headings":"","what":"ISO3 Country Codes for All African Countries — iso_codes_africa","title":"ISO3 Country Codes for All African Countries — iso_codes_africa","text":"character vector containing ISO3 country codes 54 countries Africa.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/iso_codes_africa.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ISO3 Country Codes for All African Countries — iso_codes_africa","text":"","code":"iso_codes_africa"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/iso_codes_africa.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"ISO3 Country Codes for All African Countries — iso_codes_africa","text":"character vector ISO3 country codes.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/iso_codes_africa.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"ISO3 Country Codes for All African Countries — iso_codes_africa","text":"","code":"# Access ISO3 codes for all African countries iso_codes_africa #> [1] \"DZA\" \"AGO\" \"BEN\" \"BWA\" \"BFA\" \"BDI\" \"CPV\" \"CMR\" \"CAF\" \"TCD\" \"COM\" \"COG\" #> [13] \"COD\" \"CIV\" \"DJI\" \"EGY\" \"GNQ\" \"ERI\" \"SWZ\" \"ETH\" \"GAB\" \"GMB\" \"GHA\" \"GIN\" #> [25] \"GNB\" \"KEN\" \"LSO\" \"LBR\" \"LBY\" \"MDG\" \"MWI\" \"MLI\" \"MRT\" \"MUS\" \"MAR\" \"MOZ\" #> [37] \"NAM\" \"NER\" \"NGA\" \"RWA\" \"STP\" \"SEN\" \"SYC\" \"SLE\" \"SOM\" \"ZAF\" \"SSD\" \"SDN\" #> [49] \"TGO\" \"TUN\" \"UGA\" \"TZA\" \"ZMB\" \"ZWE\""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/iso_codes_africa_central.html","id":null,"dir":"Reference","previous_headings":"","what":"ISO3 Country Codes for Central African Countries — iso_codes_africa_central","title":"ISO3 Country Codes for Central African Countries — iso_codes_africa_central","text":"character vector containing ISO3 country codes 8 countries Central Africa.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/iso_codes_africa_central.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ISO3 Country Codes for Central African Countries — iso_codes_africa_central","text":"","code":"iso_codes_africa_central"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/iso_codes_africa_central.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"ISO3 Country Codes for Central African Countries — iso_codes_africa_central","text":"character vector ISO3 country codes.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/iso_codes_africa_central.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"ISO3 Country Codes for Central African Countries — iso_codes_africa_central","text":"","code":"# Access ISO3 codes for Central African countries iso_codes_africa_central #> [1] \"AGO\" \"CAF\" \"TCD\" \"COG\" \"COD\" \"GNQ\" \"GAB\" \"STP\""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/iso_codes_africa_east.html","id":null,"dir":"Reference","previous_headings":"","what":"ISO3 Country Codes for East African Countries — iso_codes_africa_east","title":"ISO3 Country Codes for East African Countries — iso_codes_africa_east","text":"character vector containing ISO3 country codes 14 countries East Africa.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/iso_codes_africa_east.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ISO3 Country Codes for East African Countries — iso_codes_africa_east","text":"","code":"iso_codes_africa_east"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/iso_codes_africa_east.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"ISO3 Country Codes for East African Countries — iso_codes_africa_east","text":"character vector ISO3 country codes.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/iso_codes_africa_east.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"ISO3 Country Codes for East African Countries — iso_codes_africa_east","text":"","code":"# Access ISO3 codes for East African countries iso_codes_africa_east #> [1] \"BDI\" \"COM\" \"DJI\" \"ERI\" \"ETH\" \"KEN\" \"MDG\" \"MWI\" \"RWA\" \"SYC\" \"SOM\" \"SSD\" #> [13] \"TZA\" \"UGA\""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/iso_codes_africa_north.html","id":null,"dir":"Reference","previous_headings":"","what":"ISO3 Country Codes for North African Countries — iso_codes_africa_north","title":"ISO3 Country Codes for North African Countries — iso_codes_africa_north","text":"character vector containing ISO3 country codes 6 countries North Africa.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/iso_codes_africa_north.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ISO3 Country Codes for North African Countries — iso_codes_africa_north","text":"","code":"iso_codes_africa_north"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/iso_codes_africa_north.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"ISO3 Country Codes for North African Countries — iso_codes_africa_north","text":"character vector ISO3 country codes.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/iso_codes_africa_north.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"ISO3 Country Codes for North African Countries — iso_codes_africa_north","text":"","code":"# Access ISO3 codes for North African countries iso_codes_africa_north #> [1] \"DZA\" \"EGY\" \"LBY\" \"MAR\" \"SDN\" \"TUN\""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/iso_codes_africa_south.html","id":null,"dir":"Reference","previous_headings":"","what":"ISO3 Country Codes for Southern African Countries — iso_codes_africa_south","title":"ISO3 Country Codes for Southern African Countries — iso_codes_africa_south","text":"character vector containing ISO3 country codes 7 countries Southern Africa.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/iso_codes_africa_south.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ISO3 Country Codes for Southern African Countries — iso_codes_africa_south","text":"","code":"iso_codes_africa_south"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/iso_codes_africa_south.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"ISO3 Country Codes for Southern African Countries — iso_codes_africa_south","text":"character vector ISO3 country codes.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/iso_codes_africa_south.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"ISO3 Country Codes for Southern African Countries — iso_codes_africa_south","text":"","code":"# Access ISO3 codes for Southern African countries iso_codes_africa_south #> [1] \"BWA\" \"LSO\" \"NAM\" \"ZAF\" \"SWZ\" \"ZMB\" \"ZWE\""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/iso_codes_africa_west.html","id":null,"dir":"Reference","previous_headings":"","what":"ISO3 Country Codes for West African Countries — iso_codes_africa_west","title":"ISO3 Country Codes for West African Countries — iso_codes_africa_west","text":"character vector containing ISO3 country codes 16 countries West Africa.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/iso_codes_africa_west.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ISO3 Country Codes for West African Countries — iso_codes_africa_west","text":"","code":"iso_codes_africa_west"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/iso_codes_africa_west.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"ISO3 Country Codes for West African Countries — iso_codes_africa_west","text":"character vector ISO3 country codes.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/iso_codes_africa_west.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"ISO3 Country Codes for West African Countries — iso_codes_africa_west","text":"","code":"# Access ISO3 codes for West African countries iso_codes_africa_west #> [1] \"BEN\" \"BFA\" \"CPV\" \"CIV\" \"GMB\" \"GHA\" \"GIN\" \"GNB\" \"LBR\" \"MLI\" \"MRT\" \"NER\" #> [13] \"NGA\" \"SEN\" \"SLE\" \"TGO\""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/iso_codes_mosaic.html","id":null,"dir":"Reference","previous_headings":"","what":"ISO3 Country Codes for MOSAIC Modeling Framework — iso_codes_mosaic","title":"ISO3 Country Codes for MOSAIC Modeling Framework — iso_codes_mosaic","text":"character vector containing ISO3 country codes 40 countries modeled MOSAIC framework.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/iso_codes_mosaic.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ISO3 Country Codes for MOSAIC Modeling Framework — iso_codes_mosaic","text":"","code":"iso_codes_mosaic"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/iso_codes_mosaic.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"ISO3 Country Codes for MOSAIC Modeling Framework — iso_codes_mosaic","text":"character vector ISO3 country codes.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/iso_codes_mosaic.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"ISO3 Country Codes for MOSAIC Modeling Framework — iso_codes_mosaic","text":"","code":"# Access ISO3 codes for countries modeled in the MOSAIC framework iso_codes_mosaic #> [1] \"AGO\" \"BEN\" \"BWA\" \"BFA\" \"BDI\" \"CMR\" \"CAF\" \"TCD\" \"COG\" \"COD\" \"CIV\" \"GNQ\" #> [13] \"ERI\" \"SWZ\" \"ETH\" \"GAB\" \"GMB\" \"GHA\" \"GIN\" \"GNB\" \"KEN\" \"LSO\" \"LBR\" \"MWI\" #> [25] \"MLI\" \"MRT\" \"MOZ\" \"NAM\" \"NER\" \"NGA\" \"RWA\" \"SEN\" \"SLE\" \"SOM\" \"ZAF\" \"SSD\" #> [37] \"TGO\" \"UGA\" \"TZA\" \"ZMB\" \"ZWE\""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/iso_codes_ssa.html","id":null,"dir":"Reference","previous_headings":"","what":"ISO3 Country Codes for Sub-Saharan African Countries — iso_codes_ssa","title":"ISO3 Country Codes for Sub-Saharan African Countries — iso_codes_ssa","text":"character vector containing ISO3 country codes 48 countries Sub-Saharan Africa.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/iso_codes_ssa.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ISO3 Country Codes for Sub-Saharan African Countries — iso_codes_ssa","text":"","code":"iso_codes_ssa"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/iso_codes_ssa.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"ISO3 Country Codes for Sub-Saharan African Countries — iso_codes_ssa","text":"character vector ISO3 country codes.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/iso_codes_ssa.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"ISO3 Country Codes for Sub-Saharan African Countries — iso_codes_ssa","text":"","code":"# Access ISO3 codes for Sub-Saharan African countries iso_codes_ssa #> [1] \"AGO\" \"BEN\" \"BWA\" \"BFA\" \"BDI\" \"CMR\" \"CPV\" \"CAF\" \"TCD\" \"COM\" \"COG\" \"COD\" #> [13] \"CIV\" \"DJI\" \"GNQ\" \"ERI\" \"SWZ\" \"ETH\" \"GAB\" \"GMB\" \"GHA\" \"GIN\" \"GNB\" \"KEN\" #> [25] \"LSO\" \"LBR\" \"MDG\" \"MWI\" \"MLI\" \"MRT\" \"MUS\" \"MOZ\" \"NAM\" \"NER\" \"NGA\" \"RWA\" #> [37] \"STP\" \"SEN\" \"SYC\" \"SLE\" \"SOM\" \"ZAF\" \"SSD\" \"SDN\" \"TGO\" \"UGA\" \"TZA\" \"ZMB\" #> [49] \"ZWE\""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/iso_codes_who_afro.html","id":null,"dir":"Reference","previous_headings":"","what":"ISO3 Country Codes for WHO AFRO Region Countries — iso_codes_who_afro","title":"ISO3 Country Codes for WHO AFRO Region Countries — iso_codes_who_afro","text":"character vector containing ISO3 country codes 47 countries African Region (AFRO).","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/iso_codes_who_afro.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ISO3 Country Codes for WHO AFRO Region Countries — iso_codes_who_afro","text":"","code":"iso_codes_who_afro"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/iso_codes_who_afro.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"ISO3 Country Codes for WHO AFRO Region Countries — iso_codes_who_afro","text":"character vector ISO3 country codes.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/iso_codes_who_afro.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"ISO3 Country Codes for WHO AFRO Region Countries — iso_codes_who_afro","text":"","code":"# Access ISO3 codes for WHO AFRO Region countries iso_codes_who_afro #> [1] \"DZA\" \"AGO\" \"BEN\" \"BWA\" \"BFA\" \"BDI\" \"CPV\" \"CMR\" \"CAF\" \"TCD\" \"COM\" \"COG\" #> [13] \"COD\" \"CIV\" \"DJI\" \"GNQ\" \"ERI\" \"SWZ\" \"ETH\" \"GAB\" \"GMB\" \"GHA\" \"GIN\" \"GNB\" #> [25] \"KEN\" \"LSO\" \"LBR\" \"MDG\" \"MWI\" \"MLI\" \"MRT\" \"MUS\" \"MOZ\" \"NAM\" \"NER\" \"NGA\" #> [37] \"RWA\" \"STP\" \"SEN\" \"SYC\" \"SLE\" \"SOM\" \"ZAF\" \"SSD\" \"SDN\" \"TGO\" \"UGA\" \"TZA\" #> [49] \"ZMB\" \"ZWE\""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/load_or_install_packages.html","id":null,"dir":"Reference","previous_headings":"","what":"Load or Install Required Packages (with GitHub handling for mobility, propvacc, and MOSAIC) — load_or_install_packages","title":"Load or Install Required Packages (with GitHub handling for mobility, propvacc, and MOSAIC) — load_or_install_packages","text":"function checks whether specified packages installed. package installed, installed. Special handling included mobility, propvacc, MOSAIC, installed GitHub.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/load_or_install_packages.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Load or Install Required Packages (with GitHub handling for mobility, propvacc, and MOSAIC) — load_or_install_packages","text":"","code":"load_or_install_packages(packages)"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/load_or_install_packages.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Load or Install Required Packages (with GitHub handling for mobility, propvacc, and MOSAIC) — load_or_install_packages","text":"packages character vector package names load install.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/load_or_install_packages.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Load or Install Required Packages (with GitHub handling for mobility, propvacc, and MOSAIC) — load_or_install_packages","text":"packages, function installs CRAN already installed. Special cases handled following packages: mobility: Installed GitHub https://github.com/COVID-19-Mobility-Data-Network/mobility. propvacc: Installed GitHub https://github.com/gilesjohnr/propvacc. MOSAIC: Installed GitHub https://github.com/InstituteforDiseaseModeling/MOSAIC-pkg.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/load_or_install_packages.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Load or Install Required Packages (with GitHub handling for mobility, propvacc, and MOSAIC) — load_or_install_packages","text":"","code":"if (FALSE) { load_or_install_packages(c(\"ggplot2\", \"mobility\", \"propvacc\", \"MOSAIC\")) }"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/make_param_df.html","id":null,"dir":"Reference","previous_headings":"","what":"Get Template for Parameter Values — make_param_df","title":"Get Template for Parameter Values — make_param_df","text":"function generates template long-form data frame parameter values, including origin (), destination (j), time (t), used simulate variables sigma.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/make_param_df.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get Template for Parameter Values — make_param_df","text":"","code":"make_param_df( variable_name = NULL, variable_description = NULL, parameter_distribution = NULL, i = NULL, j = NULL, t = NULL, parameter_name = NULL, parameter_value = NULL )"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/make_param_df.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get Template for Parameter Values — make_param_df","text":"variable_name character string representing name variable (e.g., 'sigma'). variable_description character string describing variable (e.g., 'proportion symptomatic'). parameter_distribution character string representing distribution parameter (e.g., 'beta'). vector representing origin locations. j vector representing destination locations. t vector representing time points. parameter_name character vector parameter names (e.g., shape1, shape2 beta distribution). parameter_value numeric vector parameter values (corresponding parameter names).","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/make_param_df.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get Template for Parameter Values — make_param_df","text":"data frame containing long-form template parameter values. arguments NULL, empty data frame returned.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/make_param_df.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get Template for Parameter Values — make_param_df","text":"","code":"# Example usage for sigma prm <- list(shape1 = 2, shape2 = 5) param_df <- make_param_df(\"sigma\", \"proportion symptomatic\", \"beta\", i = \"A\", j = \"B\", t = 1, names(prm), unlist(prm)) print(param_df) #> variable_name variable_description parameter_distribution i j t #> 1 sigma proportion symptomatic beta A B 1 #> 2 sigma proportion symptomatic beta A B 1 #> parameter_name parameter_value #> 1 shape1 2 #> 2 shape2 5"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/plot_CFR_by_country.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot Case Fatality Ratios, Total Cases, and Beta Distributions by Country — plot_CFR_by_country","title":"Plot Case Fatality Ratios, Total Cases, and Beta Distributions by Country — plot_CFR_by_country","text":"function creates two separate plots: one case fatality ratios (CFR) confidence intervals total cases country, another Beta distributions selected countries. plots generated based cholera data stored PATHS$DATA_WHO_ANNUAL directory.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/plot_CFR_by_country.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot Case Fatality Ratios, Total Cases, and Beta Distributions by Country — plot_CFR_by_country","text":"","code":"plot_CFR_by_country(PATHS)"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/plot_CFR_by_country.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot Case Fatality Ratios, Total Cases, and Beta Distributions by Country — plot_CFR_by_country","text":"PATHS list containing paths cholera data figures saved. Typically generated get_paths() function include: DATA_WHO_ANNUAL: Path directory processed annual cholera data located. DOCS_FIGURES: Path directory plots saved.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/plot_CFR_by_country.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot Case Fatality Ratios, Total Cases, and Beta Distributions by Country — plot_CFR_by_country","text":"list containing two ggplot objects: one CFR total cases, one Beta distributions.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/plot_CFR_by_country.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot Case Fatality Ratios, Total Cases, and Beta Distributions by Country — plot_CFR_by_country","text":"","code":"if (FALSE) { PATHS <- get_paths() plot_CFR_by_country(PATHS) }"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/plot_ENSO_data.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot ENSO and DMI Data — plot_ENSO_data","title":"Plot ENSO and DMI Data — plot_ENSO_data","text":"function creates facet plot visualize ENSO DMI data time, separate panels variable (DMI, ENSO3, ENSO34, ENSO4). horizontal line zero included indicate neutral value, vertical line marks current date, date displayed vertically left side line.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/plot_ENSO_data.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot ENSO and DMI Data — plot_ENSO_data","text":"","code":"plot_ENSO_data(compiled_data)"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/plot_ENSO_data.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot ENSO and DMI Data — plot_ENSO_data","text":"compiled_data data frame containing ENSO DMI data, columns date, variable, value. data typically generated compile_ENSO_data function.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/plot_ENSO_data.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot ENSO and DMI Data — plot_ENSO_data","text":"ggplot facet plot showing time series DMI, ENSO3, ENSO34, ENSO4 time. plot includes: horizontal solid line zero indicate neutral sea surface temperature anomaly. vertical dashed line indicate current date, current date displayed vertical text. Facets variable, allowing easy comparison DMI ENSO regions.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/plot_ENSO_data.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Plot ENSO and DMI Data — plot_ENSO_data","text":"function uses ggplot2 create line plot facets variable (DMI, ENSO3, ENSO34, ENSO4). adds horizontal reference line zero vertical line representing current date. current date displayed vertical text aligned left vertical line. data expected date, variable, value format.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/plot_ENSO_data.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot ENSO and DMI Data — plot_ENSO_data","text":"","code":"if (FALSE) { # Compile the ENSO and DMI data from the year 2000 onwards compiled_enso_data <- compile_ENSO_data(2010, \"daily\") # Plot the data plot_ENSO_data(compiled_enso_data) }"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/plot_africa_map.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot Africa Map with Cholera Outbreak Countries — plot_africa_map","title":"Plot Africa Map with Cholera Outbreak Countries — plot_africa_map","text":"function creates map Africa highlighting countries Sub-Saharan Africa cholera outbreaks past 5 10 years. map saved PNG file specified PATHS$DOCS_FIGURES directory.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/plot_africa_map.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot Africa Map with Cholera Outbreak Countries — plot_africa_map","text":"","code":"plot_africa_map(PATHS)"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/plot_africa_map.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot Africa Map with Cholera Outbreak Countries — plot_africa_map","text":"PATHS list containing paths figure saved. Typically generated get_paths() function include: DOCS_FIGURES: Path directory map image saved.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/plot_africa_map.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot Africa Map with Cholera Outbreak Countries — plot_africa_map","text":"ggplot object showing map.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/plot_africa_map.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Plot Africa Map with Cholera Outbreak Countries — plot_africa_map","text":"function generates map Africa, highlighting Sub-Saharan African countries cholera outbreaks past 5 10 years. map saved PNG file.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/plot_africa_map.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot Africa Map with Cholera Outbreak Countries — plot_africa_map","text":"","code":"if (FALSE) { # Assuming PATHS is generated from get_paths() PATHS <- get_paths() plot_africa_map(PATHS) }"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/plot_generation_time.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot Generation Time as Gamma Distribution for Days and Weeks — plot_generation_time","title":"Plot Generation Time as Gamma Distribution for Days and Weeks — plot_generation_time","text":"function generates combined plot generation time probability distribution days (based gamma distribution) aggregated weeks. resulting plot saved PNG file.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/plot_generation_time.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot Generation Time as Gamma Distribution for Days and Weeks — plot_generation_time","text":"","code":"plot_generation_time(PATHS)"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/plot_generation_time.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot Generation Time as Gamma Distribution for Days and Weeks — plot_generation_time","text":"PATHS list containing paths plot saved. Typically generated get_paths() function include: DOCS_FIGURES: Path directory generation time plot saved.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/plot_mobility.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot Mobility Data, Mobility Network, and Results — plot_mobility","title":"Plot Mobility Data, Mobility Network, and Results — plot_mobility","text":"function loads visualizes mobility data, including flight data, travel probabilities, diffusion model estimates, mobility network.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/plot_mobility.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot Mobility Data, Mobility Network, and Results — plot_mobility","text":"","code":"plot_mobility(PATHS)"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/plot_mobility.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot Mobility Data, Mobility Network, and Results — plot_mobility","text":"PATHS list containing paths data, models, figures stored. Typically generated get_paths() function include: MODEL_INPUT: Path directory mobility matrices parameter estimates saved. DATA_SHAPEFILES: Path directory containing shapefiles African countries. DOCS_FIGURES: Path directory figures saved.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/plot_mobility.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot Mobility Data, Mobility Network, and Results — plot_mobility","text":"function generates saves mobility-related visualizations PNG files.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/plot_shedding_rate.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot Shedding Rate as a Function of Environmental Suitability — plot_shedding_rate","title":"Plot Shedding Rate as a Function of Environmental Suitability — plot_shedding_rate","text":"function generates plot visualizes suitability-dependent decay rate environmental shedding based climate-driven environmental suitability (\\(\\psi_{jt}\\)). function generates three models decay rate \\(\\delta_{jt}\\): \\(\\delta_{jt} = 1 - \\psi_{jt}\\): simple linear transformation \\(\\psi_{jt}\\). \\(\\delta_{jt} = 1 - \\frac{1}{1 + (1 - \\psi_{jt})}\\): nonlinear transformation \\(\\psi_{jt}\\). \\(\\delta_{jt} = \\delta_{\\min} + \\psi_{jt} \\cdot (\\delta_{\\max} - \\delta_{\\min})\\): linear transformation based minimum maximum decay rates. plot saved PNG file directory specified PATHS$DOCS_FIGURES.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/plot_shedding_rate.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot Shedding Rate as a Function of Environmental Suitability — plot_shedding_rate","text":"","code":"plot_shedding_rate(PATHS)"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/plot_shedding_rate.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot Shedding Rate as a Function of Environmental Suitability — plot_shedding_rate","text":"PATHS list containing paths plot saved. Typically generated get_paths() function include: DOCS_FIGURES: Path directory plot saved.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/plot_shedding_rate.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot Shedding Rate as a Function of Environmental Suitability — plot_shedding_rate","text":"","code":"if (FALSE) { # Assuming PATHS is generated from get_paths() PATHS <- get_paths() plot_shedding_rate(PATHS) }"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/plot_suspected_cases.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot Proportion of Suspected Cholera Cases — plot_suspected_cases","title":"Plot Proportion of Suspected Cholera Cases — plot_suspected_cases","text":"function loads parameter data frame proportion suspected cholera cases (rho) param_rho_suspected_cases.csv file generates plot showing probability distributions low high estimates, custom annotations formatting.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/plot_suspected_cases.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot Proportion of Suspected Cholera Cases — plot_suspected_cases","text":"","code":"plot_suspected_cases(PATHS)"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/plot_suspected_cases.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot Proportion of Suspected Cholera Cases — plot_suspected_cases","text":"PATHS list containing paths parameter data figures saved. Typically generated get_paths() function include: MODEL_INPUT: Path directory parameter data frame stored. DOCS_FIGURES: Path directory plot saved.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/plot_vaccine_effectiveness.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot Vaccine Effectiveness and Beta Distribution — plot_vaccine_effectiveness","title":"Plot Vaccine Effectiveness and Beta Distribution — plot_vaccine_effectiveness","text":"function generates two plots: one showing vaccine effectiveness decay time, another showing Beta distribution initial vaccine effectiveness.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/plot_vaccine_effectiveness.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot Vaccine Effectiveness and Beta Distribution — plot_vaccine_effectiveness","text":"","code":"plot_vaccine_effectiveness(PATHS)"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/plot_vaccine_effectiveness.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot Vaccine Effectiveness and Beta Distribution — plot_vaccine_effectiveness","text":"PATHS list containing paths figures saved. Typically generated get_paths() function include: DOCS_FIGURES: Path directory figures saved.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/process_CFR_data.html","id":null,"dir":"Reference","previous_headings":"","what":"Process Cholera Data to Calculate Aggregated Case Fatality Ratios and Fit Beta Distributions (2014-2024) — process_CFR_data","title":"Process Cholera Data to Calculate Aggregated Case Fatality Ratios and Fit Beta Distributions (2014-2024) — process_CFR_data","text":"function processes cholera data, aggregates cases deaths country period 2014-2024, calculates aggregated Case Fatality Ratio (CFR), fits Beta distributions country. Countries fewer cases min_obs CFR set value AFRO Region.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/process_CFR_data.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Process Cholera Data to Calculate Aggregated Case Fatality Ratios and Fit Beta Distributions (2014-2024) — process_CFR_data","text":"","code":"process_CFR_data(PATHS, min_obs)"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/process_CFR_data.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Process Cholera Data to Calculate Aggregated Case Fatality Ratios and Fit Beta Distributions (2014-2024) — process_CFR_data","text":"PATHS list containing paths cholera data located. Typically generated get_paths() function include: DATA_WHO_ANNUAL: Path directory containing processed annual cholera data. DOCS_TABLES: Path directory processed CFR data saved. min_obs integer specifying minimum number cases required country CFR. Countries fewer cases threshold CFR set value AFRO Region.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/process_CFR_data.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Process Cholera Data to Calculate Aggregated Case Fatality Ratios and Fit Beta Distributions (2014-2024) — process_CFR_data","text":"data frame aggregated CFR, confidence intervals, Beta distribution parameters country.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/process_CFR_data.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Process Cholera Data to Calculate Aggregated Case Fatality Ratios and Fit Beta Distributions (2014-2024) — process_CFR_data","text":"","code":"if (FALSE) { PATHS <- get_paths() cholera_data <- process_CFR_data(PATHS, min_obs = 100) }"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/process_OAG_data.html","id":null,"dir":"Reference","previous_headings":"","what":"Process and Save OAG Flight Data for Africa — process_OAG_data","title":"Process and Save OAG Flight Data for Africa — process_OAG_data","text":"function processes raw OAG flight data African countries, including data cleaning, location date conversion, aggregation. processed data saved CSV files African countries subset countries used MOSAIC modeling framework.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/process_OAG_data.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Process and Save OAG Flight Data for Africa — process_OAG_data","text":"","code":"process_OAG_data(PATHS)"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/process_OAG_data.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Process and Save OAG Flight Data for Africa — process_OAG_data","text":"PATHS list containing paths raw processed data stored. PATHS typically output get_paths() function include following components: DATA_RAW: Path directory containing raw data files. DATA_PROCESSED: Path directory processed data saved. DATA_SHAPEFILES: Path directory containing shapefiles African countries.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/process_OAG_data.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Process and Save OAG Flight Data for Africa — process_OAG_data","text":"function processes OAG flight data saves aggregated results specified processed data paths.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/process_OAG_data.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Process and Save OAG Flight Data for Africa — process_OAG_data","text":"","code":"if (FALSE) { # Define paths for raw and processed data using get_paths() PATHS <- get_paths() # Process the OAG data and save the results process_OAG_data(PATHS) }"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/process_WHO_annual_data.html","id":null,"dir":"Reference","previous_headings":"","what":"Download, Process, and Save Historical Annual WHO Cholera Data for Africa — process_WHO_annual_data","title":"Download, Process, and Save Historical Annual WHO Cholera Data for Africa — process_WHO_annual_data","text":"function compiles historical cholera data African countries (AFRO region) years 1949 2024. data processed saved MOSAIC directory structure. includes reported cholera cases, deaths, case fatality ratios (CFR).","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/process_WHO_annual_data.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Download, Process, and Save Historical Annual WHO Cholera Data for Africa — process_WHO_annual_data","text":"","code":"process_WHO_annual_data(PATHS)"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/process_WHO_annual_data.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Download, Process, and Save Historical Annual WHO Cholera Data for Africa — process_WHO_annual_data","text":"PATHS list containing paths raw processed data directories. Typically generated get_paths() include: DATA_RAW: Path directory containing raw cholera data. DATA_WHO_ANNUAL: Path directory processed cholera data saved.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/process_WHO_annual_data.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Download, Process, and Save Historical Annual WHO Cholera Data for Africa — process_WHO_annual_data","text":"function return value processes saves historical cholera data CSV files processed data directory.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/process_WHO_annual_data.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Download, Process, and Save Historical Annual WHO Cholera Data for Africa — process_WHO_annual_data","text":"function compiles cholera data African countries (AFRO region) processing historical data 1949-2024. data sources follows: 1949-2021: Data compiled annual reports World Data. See https://ourworldindata.org. 2022: Data manually extracted annual report. 2023-2024: Data downloaded directly AWD GIS dashboard. Additionally, function calculates 95% binomial confidence intervals CFR applicable, data saved CSV files processed data directory.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/process_WHO_annual_data.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Download, Process, and Save Historical Annual WHO Cholera Data for Africa — process_WHO_annual_data","text":"","code":"if (FALSE) { # Assuming PATHS is generated from get_paths() PATHS <- get_paths() # Download and process WHO annual cholera data process_WHO_annual_data(PATHS) }"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/process_WHO_weekly_data.html","id":null,"dir":"Reference","previous_headings":"","what":"Process Weekly Cholera Data: Convert Country Names to ISO3 and Filter by AFRO Countries — process_WHO_weekly_data","title":"Process Weekly Cholera Data: Convert Country Names to ISO3 and Filter by AFRO Countries — process_WHO_weekly_data","text":"function processes cholera data converting country names ISO3 codes, filtering AFRO region countries, cleaning organizing data analysis.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/process_WHO_weekly_data.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Process Weekly Cholera Data: Convert Country Names to ISO3 and Filter by AFRO Countries — process_WHO_weekly_data","text":"","code":"process_WHO_weekly_data(PATHS)"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/process_WHO_weekly_data.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Process Weekly Cholera Data: Convert Country Names to ISO3 and Filter by AFRO Countries — process_WHO_weekly_data","text":"PATHS list containing paths raw processed data directories. Typically generated get_paths() function include: DATA_RAW: Path raw cholera data file (e.g., cholera_country_weekly.csv). DATA_PROCESSED: Path save processed cholera data (e.g., cholera_country_weekly_processed.csv).","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/process_WHO_weekly_data.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Process Weekly Cholera Data: Convert Country Names to ISO3 and Filter by AFRO Countries — process_WHO_weekly_data","text":"function return value processes cholera data saves specified file CSV.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/process_WHO_weekly_data.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Process Weekly Cholera Data: Convert Country Names to ISO3 and Filter by AFRO Countries — process_WHO_weekly_data","text":"function reads cholera data, converts country names ISO3 codes (vice versa), filters countries AFRO region, ensures data cleaned organized year week. also handles special cases renaming Democratic Republic Congo Congo (Republic) modifies column names consistency.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/process_WHO_weekly_data.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Process Weekly Cholera Data: Convert Country Names to ISO3 and Filter by AFRO Countries — process_WHO_weekly_data","text":"","code":"if (FALSE) { # Assuming PATHS is generated from get_paths() PATHS <- get_paths() # Process cholera data process_WHO_weekly_data(PATHS) }"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/process_demographics_data.html","id":null,"dir":"Reference","previous_headings":"","what":"Process UN World Prospects Data for African Countries — process_demographics_data","title":"Process UN World Prospects Data for African Countries — process_demographics_data","text":"function processes demographic data UN World Population Prospects African countries. filters data specified years, calculates population, birth rates, death rates per day, saves processed data CSV file.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/process_demographics_data.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Process UN World Prospects Data for African Countries — process_demographics_data","text":"","code":"process_demographics_data(PATHS)"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/process_demographics_data.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Process UN World Prospects Data for African Countries — process_demographics_data","text":"PATHS list containing paths raw processed data stored. PATHS typically output get_paths() function include following components: DATA_RAW: Path directory containing raw UN World Population Prospects data. DATA_PROCESSED: Path directory processed demographic data saved.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/process_demographics_data.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Process UN World Prospects Data for African Countries — process_demographics_data","text":"function return value. processes UN demographic data saves aggregated results CSV file specified directory.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/process_demographics_data.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Process UN World Prospects Data for African Countries — process_demographics_data","text":"function performs following steps: Loads raw demographic data CSV file. Filters data specified years African countries. Calculates population, birth rate, death rate per day country. Saves processed data CSV file processed data directory. processed data file saved PATHS$DATA_PROCESSED/demographics/ directory, filename includes year range data.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/process_demographics_data.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Process UN World Prospects Data for African Countries — process_demographics_data","text":"","code":"if (FALSE) { # Define paths for raw and processed data using get_paths() PATHS <- get_paths() # Process the UN World Prospects data and save the results process_demographics_data(PATHS) }"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/run_WHO_annual_data_app.html","id":null,"dir":"Reference","previous_headings":"","what":"Run Shiny Application for Visualizing WHO Annual Cholera Data in AFRO Countries — run_WHO_annual_data_app","title":"Run Shiny Application for Visualizing WHO Annual Cholera Data in AFRO Countries — run_WHO_annual_data_app","text":"function launches Shiny app visualizes cholera cases, deaths, case fatality rate (CFR) countries AFRO region 1970 2024. Users can select metric (cases, deaths, CFR) filter specific countries.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/run_WHO_annual_data_app.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Run Shiny Application for Visualizing WHO Annual Cholera Data in AFRO Countries — run_WHO_annual_data_app","text":"","code":"run_WHO_annual_data_app(PATHS)"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/run_WHO_annual_data_app.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Run Shiny Application for Visualizing WHO Annual Cholera Data in AFRO Countries — run_WHO_annual_data_app","text":"PATHS list containing paths processed cholera data file. Typically generated get_paths() function include: DATA_WHO_ANNUAL: Path directory containing processed cholera data file (e.g., who_afro_annual_1949_2024.csv).","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/run_WHO_annual_data_app.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Run Shiny Application for Visualizing WHO Annual Cholera Data in AFRO Countries — run_WHO_annual_data_app","text":"function creates Shiny app allows users explore cholera incidence data across AFRO countries 1970 2024. Users can choose viewing cases, deaths, CFR can select specific countries visualization. app generates bar plots cases deaths, point plots error bars CFR.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/run_WHO_annual_data_app.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Run Shiny Application for Visualizing WHO Annual Cholera Data in AFRO Countries — run_WHO_annual_data_app","text":"","code":"if (FALSE) { # Define paths for processed data PATHS <- get_paths() # Run the cholera Shiny app run_WHO_annual_data_app(PATHS) }"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/set_openmeteo_api_key.html","id":null,"dir":"Reference","previous_headings":"","what":"Set OpenMeteo API Key — set_openmeteo_api_key","title":"Set OpenMeteo API Key — set_openmeteo_api_key","text":"function sets OpenMeteo API key stores global option called openmeteo_api_key. API key provided argument, used. , function prompt key interactively.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/set_openmeteo_api_key.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Set OpenMeteo API Key — set_openmeteo_api_key","text":"","code":"set_openmeteo_api_key(api_key = NULL)"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/set_openmeteo_api_key.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Set OpenMeteo API Key — set_openmeteo_api_key","text":"api_key character string representing OpenMeteo API key. NULL, function prompt key interactively.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/set_openmeteo_api_key.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Set OpenMeteo API Key — set_openmeteo_api_key","text":"message confirming API key set, instructions retrieving key.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/set_openmeteo_api_key.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Set OpenMeteo API Key — set_openmeteo_api_key","text":"API key stored global option called openmeteo_api_key using options(). key can retrieved time using getOption(\"openmeteo_api_key\").","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/set_openmeteo_api_key.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Set OpenMeteo API Key — set_openmeteo_api_key","text":"","code":"# Set the OpenMeteo API key interactively set_openmeteo_api_key() #> Please enter your OpenMeteo API key: #> Error in set_openmeteo_api_key(): API key cannot be empty. Please provide a valid API key. # Set the OpenMeteo API key programmatically set_openmeteo_api_key(\"your-api-key-here\") #> OpenMeteo API key set successfully. #> Retrieve with getOption('openmeteo_api_key') # Access the API key getOption(\"openmeteo_api_key\") #> [1] \"your-api-key-here\""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/set_root_directory.html","id":null,"dir":"Reference","previous_headings":"","what":"Set Root Directory — set_root_directory","title":"Set Root Directory — set_root_directory","text":"function sets root directory user-specified path , provided, prompts user enter root directory interactively. directory path stored global option called root_directory also returned.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/set_root_directory.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Set Root Directory — set_root_directory","text":"","code":"set_root_directory(root = NULL)"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/set_root_directory.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Set Root Directory — set_root_directory","text":"root character string representing path root directory. NULL, function prompt user enter root directory interactively.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/set_root_directory.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Set Root Directory — set_root_directory","text":"character string representing root directory. root directory also stored globally option root_directory.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/set_root_directory.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Set Root Directory — set_root_directory","text":"function uses either user-specified path path provided interactively set root directory. path validated ensure exists. validated, path stored global option root_directory, can accessed using getOption(\"root_directory\"). path invalid (.e., exist), function throws error.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/set_root_directory.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Set Root Directory — set_root_directory","text":"","code":"if (FALSE) { # Set and display the root directory interactively root_dir <- set_root_directory() cat(\"Root directory:\", root_dir, \"\\n\") # Set the root directory programmatically root_dir <- set_root_directory(\"/path/to/root\") cat(\"Root directory:\", root_dir, \"\\n\") # Access the root directory from the global options getOption(\"root_directory\") }"}]
+[{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/articles/Project-setup.html","id":"instructions-to-setup-a-mosaic-project-programmatically","dir":"Articles","previous_headings":"","what":"Instructions to setup a MOSAIC project programmatically","title":"Project setup","text":"following instructions guide setting MOSAIC project directory programmatically cloning necessary repositories using Bash script.","code":"#!/bin/bash # Set the MOSAIC parent directory MOSAIC_DIR=\"MOSAIC\" # Create the MOSAIC directory if it doesn't exist if [ ! -d \"$MOSAIC_DIR\" ]; then mkdir \"$MOSAIC_DIR\" echo \"Created directory: $MOSAIC_DIR\" fi # Change to the MOSAIC directory cd \"$MOSAIC_DIR\" # Clone the MOSAIC-data repository if [ ! -d \"MOSAIC-data\" ]; then git clone git@github.com:InstituteforDiseaseModeling/MOSAIC-data.git echo \"Cloned MOSAIC-data repository.\" else echo \"MOSAIC-data repository already exists.\" fi # Clone the MOSAIC-pkg repository if [ ! -d \"MOSAIC-pkg\" ]; then git clone git@github.com:InstituteforDiseaseModeling/MOSAIC-pkg.git echo \"Cloned MOSAIC-pkg repository.\" else echo \"MOSAIC-pkg repository already exists.\" fi # Clone the MOSAIC-docs repository if [ ! -d \"MOSAIC-docs\" ]; then git clone git@github.com:InstituteforDiseaseModeling/MOSAIC-docs.git echo \"Cloned MOSAIC-docs repository.\" else echo \"MOSAIC-docs repository already exists.\" fi echo \"MOSAIC project setup complete.\" #> Created directory: MOSAIC #> #> Cloning into 'MOSAIC-data'... #> Cloned MOSAIC-data repository. #> Cloning into 'MOSAIC-pkg'... #> Cloned MOSAIC-pkg repository. #> Cloning into 'MOSAIC-docs'... #> Cloned MOSAIC-docs repository. #> MOSAIC project setup complete."},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"John R Giles. Author, maintainer.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Giles J (2024). MOSAIC: Metapopulation Outbreak Simulation Interventions Cholera (MOSAIC). R package version 0.0.1.","code":"@Manual{, title = {MOSAIC: Metapopulation Outbreak Simulation And Interventions for Cholera (MOSAIC)}, author = {John R Giles}, year = {2024}, note = {R package version 0.0.1}, }"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/index.html","id":"mosaic-the-metapopulation-outbreak-simulation-with-agent-based-implementation-for-cholera-","dir":"","previous_headings":"","what":"Metapopulation Outbreak Simulation And Interventions for Cholera (MOSAIC)","title":"Metapopulation Outbreak Simulation And Interventions for Cholera (MOSAIC)","text":" Welcome R package MOSAIC framework. MOSAIC R package provides tools simulating cholera transmission dynamics using metapopulation models, estimating mobility patterns drivers transmission environmental forcing, visualizing disease dynamics outbreak projections. Note repo holds code data models , full documentation see: https://institutefordiseasemodeling.github.io/MOSAIC-docs/.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/index.html","id":"mosaic-project-directory-structure","dir":"","previous_headings":"","what":"MOSAIC Project Directory Structure","title":"Metapopulation Outbreak Simulation And Interventions for Cholera (MOSAIC)","text":"MOSAIC R package designed used within triad Github repos functions documented MOSAIC-pkg. package downloads processes required data saved MOSAIC-data prepares model quantities run MOSAIC saved MOSAIC-pkg/model/input. package also produces figures tables used make documentation located MOSAIC-docs. directory structure MOSAIC project. See ./src/mosiac_setup.sh project setup script.","code":"MOSAIC/ # Local parent directory to hold 3 repositories, root directory in get_paths() ├── MOSAIC-data/ │ ├── raw/ # Raw data files supplied to MOSAIC-pkg │ └── processed/ # Processed data files supplied to MOSAIC-pkg ├── MOSAIC-pkg/ │ ├── [R package] # Contents of MOSAIC R package: https://gilesjohnr.github.io/MOSAIC-pkg/ │ └── model/ │ ├── input/ # Files used as input to MOSAIC framework │ ├── output/ # Location of output from MOSAIC framework │ └── LAUNCH.R # LAUNCH.R file runs data acquisition functions, a priori models, and runs MOSAIC └── MOSAIC-docs/ ├── [Website] # Documentation and model description: https://gilesjohnr.github.io/MOSAIC-docs/ ├── figures/ # Output images and figures from MOSAIC-pkg used in documentation └── tables/ # Output data and parameter values from MOSAIC-pkg used in documentation"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/index.html","id":"contact","dir":"","previous_headings":"","what":"Contact","title":"Metapopulation Outbreak Simulation And Interventions for Cholera (MOSAIC)","text":"questions information MOSAIC project, please contact: John Giles: john.giles@gatesfoundation.org Jillian Gauld: jillian.gauld@gatesfoundation.org Rajiv Sodhi: rajiv.sodhi@gatesfoundation.org","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/compile_ENSO_data.html","id":null,"dir":"Reference","previous_headings":"","what":"Compile ENSO and DMI Data (Historical and Forecast) — compile_ENSO_data","title":"Compile ENSO and DMI Data (Historical and Forecast) — compile_ENSO_data","text":"function compiles historical forecast data DMI ENSO (Niño3, Niño3.4, Niño4) single data frame. data filtered include years specified year_start onwards. function also allows disaggregation monthly data daily weekly values using either linear interpolation spline interpolation.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/compile_ENSO_data.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Compile ENSO and DMI Data (Historical and Forecast) — compile_ENSO_data","text":"","code":"compile_ENSO_data(year_start = NULL, frequency = \"monthly\", method = \"linear\")"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/compile_ENSO_data.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Compile ENSO and DMI Data (Historical and Forecast) — compile_ENSO_data","text":"year_start integer representing start year filtering data. data year onward included compiled data. value must greater equal 1870. frequency character string specifying time resolution output data. Valid options \"daily\", \"weekly\", \"monthly\". method character string specifying interpolation method use. Valid options \"linear\" (linear interpolation using zoo::na.approx()) \"spline\" (spline interpolation using zoo::na.spline()).","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/compile_ENSO_data.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Compile ENSO and DMI Data (Historical and Forecast) — compile_ENSO_data","text":"data frame combined historical forecast data DMI, ENSO3, ENSO34, ENSO4. data frame includes following columns: date: date data (daily, weekly, monthly) YYYY-MM-DD format. variable: variable name, can \"DMI\", \"ENSO3\", \"ENSO34\", \"ENSO4\". value: value variable (sea surface temperature anomaly). year: year corresponding date. month: month corresponding date. week: week year (\"weekly\" \"daily\" frequency). doy: day year (\"daily\" frequency).","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/compile_ENSO_data.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Compile ENSO and DMI Data (Historical and Forecast) — compile_ENSO_data","text":"","code":"if (FALSE) { # Compile the ENSO and DMI data from the year 2000 onwards compiled_enso_data <- compile_ENSO_data(2010, \"monthly\") # Display the compiled data head(compiled_enso_data) }"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/convert_country_to_iso.html","id":null,"dir":"Reference","previous_headings":"","what":"Convert Country Names to ISO3 or ISO2 Country Codes — convert_country_to_iso","title":"Convert Country Names to ISO3 or ISO2 Country Codes — convert_country_to_iso","text":"function converts country names corresponding ISO3 ISO2 country codes. function uses countrycode package, allows multiple spellings variations country names.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/convert_country_to_iso.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Convert Country Names to ISO3 or ISO2 Country Codes — convert_country_to_iso","text":"","code":"convert_country_to_iso(x, iso3 = TRUE)"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/convert_country_to_iso.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Convert Country Names to ISO3 or ISO2 Country Codes — convert_country_to_iso","text":"x character vector country names (e.g., \"United States\", \"UK\", \"Democratic Republic Congo\"). iso3 logical value. TRUE (default), returns ISO3 country codes. FALSE, returns ISO2 country codes.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/convert_country_to_iso.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Convert Country Names to ISO3 or ISO2 Country Codes — convert_country_to_iso","text":"character vector ISO3 ISO2 country codes corresponding country names.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/convert_country_to_iso.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Convert Country Names to ISO3 or ISO2 Country Codes — convert_country_to_iso","text":"function converts country names ISO3 ISO2 codes using countrycode package. handles various common alternative spellings country names.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/convert_country_to_iso.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Convert Country Names to ISO3 or ISO2 Country Codes — convert_country_to_iso","text":"","code":"# Convert a single country name to ISO3 convert_country_to_iso(\"United States\") #> [1] \"USA\" # Convert a vector of country names to ISO2 convert_country_to_iso(c(\"United States\", \"UK\", \"Democratic Republic of Congo\"), iso3 = FALSE) #> [1] \"US\" \"GB\" \"CD\""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/convert_iso_codes.html","id":null,"dir":"Reference","previous_headings":"","what":"Convert ISO3 to ISO2 or ISO2 to ISO3 Country Codes — convert_iso_codes","title":"Convert ISO3 to ISO2 or ISO2 to ISO3 Country Codes — convert_iso_codes","text":"function converts vector scalar ISO3 country codes ISO2 country codes, vice versa, based input. function uses countrycode package auto-detects input format.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/convert_iso_codes.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Convert ISO3 to ISO2 or ISO2 to ISO3 Country Codes — convert_iso_codes","text":"","code":"convert_iso_codes(iso_codes)"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/convert_iso_codes.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Convert ISO3 to ISO2 or ISO2 to ISO3 Country Codes — convert_iso_codes","text":"iso_codes vector scalar ISO2 ISO3 country codes (e.g., \"USA\", \"GBR\", \"ZA\", \"GB\").","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/convert_iso_codes.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Convert ISO3 to ISO2 or ISO2 to ISO3 Country Codes — convert_iso_codes","text":"character vector converted ISO2 ISO3 country codes corresponding provided input.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/convert_iso_codes.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Convert ISO3 to ISO2 or ISO2 to ISO3 Country Codes — convert_iso_codes","text":"function detects whether input ISO2 ISO3 format based code length converts accordingly using countrycode package.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/convert_iso_codes.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Convert ISO3 to ISO2 or ISO2 to ISO3 Country Codes — convert_iso_codes","text":"","code":"# Convert a vector of ISO3 codes to ISO2 codes convert_iso_codes(c(\"USA\", \"GBR\", \"DZA\")) #> [1] \"US\" \"GB\" \"DZ\" # Convert a vector of ISO2 codes to ISO3 codes convert_iso_codes(c(\"US\", \"GB\", \"DZ\")) #> [1] \"USA\" \"GBR\" \"DZA\""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/convert_iso_to_country.html","id":null,"dir":"Reference","previous_headings":"","what":"Convert ISO2 or ISO3 Country Codes to Country Names — convert_iso_to_country","title":"Convert ISO2 or ISO3 Country Codes to Country Names — convert_iso_to_country","text":"function converts vector scalar ISO2 ISO3 country codes corresponding country names using countrycode package.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/convert_iso_to_country.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Convert ISO2 or ISO3 Country Codes to Country Names — convert_iso_to_country","text":"","code":"convert_iso_to_country(iso)"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/convert_iso_to_country.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Convert ISO2 or ISO3 Country Codes to Country Names — convert_iso_to_country","text":"iso vector scalar ISO2 ISO3 country codes (e.g., \"USA\", \"GB\", \"DZA\").","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/convert_iso_to_country.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Convert ISO2 or ISO3 Country Codes to Country Names — convert_iso_to_country","text":"character vector country names corresponding provided ISO2 ISO3 country codes.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/convert_iso_to_country.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Convert ISO2 or ISO3 Country Codes to Country Names — convert_iso_to_country","text":"function automatically detects input ISO2 ISO3 format returns corresponding country names. Special handling applied Congo Democratic Republic Congo.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/convert_iso_to_country.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Convert ISO2 or ISO3 Country Codes to Country Names — convert_iso_to_country","text":"","code":"# Convert a vector of ISO3 and ISO2 codes to country names convert_iso_to_country(c(\"USA\", \"GBR\", \"DZA\", \"COD\")) #> [1] \"United States\" \"United Kingdom\" #> [3] \"Algeria\" \"Democratic Republic of Congo\""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/download_africa_shapefile.html","id":null,"dir":"Reference","previous_headings":"","what":"Download and Save Africa Shapefile — download_africa_shapefile","title":"Download and Save Africa Shapefile — download_africa_shapefile","text":"function downloads shapefile African countries using rnaturalearth package saves specified directory. output directory exist, created.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/download_africa_shapefile.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Download and Save Africa Shapefile — download_africa_shapefile","text":"","code":"download_africa_shapefile(PATHS)"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/download_africa_shapefile.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Download and Save Africa Shapefile — download_africa_shapefile","text":"PATHS list environment containing path structure, PATHS$DATA_PROCESSED specifies directory save processed shapefile.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/download_africa_shapefile.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Download and Save Africa Shapefile — download_africa_shapefile","text":"message indicating shapefile saved, including full path saved file.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/download_africa_shapefile.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Download and Save Africa Shapefile — download_africa_shapefile","text":"function uses rnaturalearth package download shapefile African continent. shapefile saved AFRICA_ADM0.shp directory specified PATHS$DATA_PROCESSED/shapefiles. function create directory already exist.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/download_africa_shapefile.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Download and Save Africa Shapefile — download_africa_shapefile","text":"","code":"if (FALSE) { # Example PATHS object PATHS <- list(DATA_PROCESSED = \"path/to/processed/data\") # Download and save the Africa shapefile download_africa_shapefile(PATHS) }"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/download_all_country_shapefiles.html","id":null,"dir":"Reference","previous_headings":"","what":"Download and Save Shapefiles for All African Countries — download_all_country_shapefiles","title":"Download and Save Shapefiles for All African Countries — download_all_country_shapefiles","text":"function downloads shapefiles African country saves specified directory. function iterates ISO3 country codes Africa (MOSAIC framework) saves country's shapefile individually.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/download_all_country_shapefiles.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Download and Save Shapefiles for All African Countries — download_all_country_shapefiles","text":"","code":"download_all_country_shapefiles(PATHS)"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/download_all_country_shapefiles.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Download and Save Shapefiles for All African Countries — download_all_country_shapefiles","text":"PATHS list containing paths processed data saved. PATHS typically output get_paths() function include: DATA_PROCESSED: Path directory processed shapefiles saved.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/download_all_country_shapefiles.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Download and Save Shapefiles for All African Countries — download_all_country_shapefiles","text":"function return value. downloads shapefiles African country saves individual shapefiles processed data directory.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/download_all_country_shapefiles.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Download and Save Shapefiles for All African Countries — download_all_country_shapefiles","text":"function performs following steps: Creates output directory shapefiles exist. Loops list ISO3 country codes African countries. Downloads country's shapefile using MOSAIC::get_country_shp(). Saves shapefile processed data directory ISO3_ADM0.shp.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/download_all_country_shapefiles.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Download and Save Shapefiles for All African Countries — download_all_country_shapefiles","text":"","code":"if (FALSE) { # Define paths for processed data using get_paths() PATHS <- get_paths() # Download and save shapefiles for all African countries download_all_country_shapefiles(PATHS) }"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/download_climate_data.html","id":null,"dir":"Reference","previous_headings":"","what":"Download and Save Climate Data for Multiple Countries (Parquet Format, Multiple Models and Variables) — download_climate_data","title":"Download and Save Climate Data for Multiple Countries (Parquet Format, Multiple Models and Variables) — download_climate_data","text":"function downloads daily climate data list specified countries, saving data Parquet files. data includes historical future climate variables grid points within country specified set climate models variables.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/download_climate_data.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Download and Save Climate Data for Multiple Countries (Parquet Format, Multiple Models and Variables) — download_climate_data","text":"","code":"download_climate_data( PATHS, iso_codes, n_points, date_start, date_stop, climate_models, climate_variables, api_key )"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/download_climate_data.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Download and Save Climate Data for Multiple Countries (Parquet Format, Multiple Models and Variables) — download_climate_data","text":"PATHS list containing paths raw processed data stored. PATHS typically output get_paths() function include: DATA_SHAPEFILES: Path directory containing country shapefiles. DATA_CLIMATE: Path directory processed climate data saved. iso_codes character vector ISO3 country codes climate data downloaded. n_points integer specifying number grid points generate within country climate data downloaded. date_start character string representing start date climate data (\"YYYY-MM-DD\" format). date_stop character string representing end date climate data (\"YYYY-MM-DD\" format). climate_models character vector climate models use. Available models include: CMCC_CM2_VHR4 FGOALS_f3_H HiRAM_SIT_HR MRI_AGCM3_2_S EC_Earth3P_HR MPI_ESM1_2_XR NICAM16_8S climate_variables character vector climate variables retrieve. See details available variables. api_key character string representing API key required access climate data API.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/download_climate_data.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Download and Save Climate Data for Multiple Countries (Parquet Format, Multiple Models and Variables) — download_climate_data","text":"function return value. downloads climate data country, climate model, climate variable, saving results Parquet files specified directory.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/download_climate_data.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Download and Save Climate Data for Multiple Countries (Parquet Format, Multiple Models and Variables) — download_climate_data","text":"function uses country shapefiles generate grid points within country, climate data downloaded. function retrieves climate data specified date range (date_start date_stop) specified climate models variables. data saved country, climate model, climate variable Parquet file named climate_data_{climate_model}_{climate_variable}_{date_start}_{date_stop}_{ISO3}.parquet. available climate variables include: temperature_2m_mean, temperature_2m_max, temperature_2m_min wind_speed_10m_mean, wind_speed_10m_max cloud_cover_mean shortwave_radiation_sum relative_humidity_2m_mean, relative_humidity_2m_max, relative_humidity_2m_min dew_point_2m_mean, dew_point_2m_min, dew_point_2m_max precipitation_sum, rain_sum, snowfall_sum pressure_msl_mean soil_moisture_0_to_10cm_mean et0_fao_evapotranspiration_sum","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/download_climate_data.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Download and Save Climate Data for Multiple Countries (Parquet Format, Multiple Models and Variables) — download_climate_data","text":"","code":"if (FALSE) { # Define paths for raw and processed data using get_paths() PATHS <- get_paths() # ISO3 country codes for African countries iso_codes <- c(\"ZAF\", \"KEN\", \"NGA\") # API key for climate data API api_key <- \"your-api-key-here\" # Download climate data for multiple models and variables and save it for the specified countries download_climate_data(PATHS, iso_codes, n_points = 5, date_start = \"1970-01-01\", date_stop = \"2030-12-31\", climate_models = c(\"MRI_AGCM3_2_S\", \"EC_Earth3P_HR\"), climate_variables = c(\"temperature_2m_mean\", \"precipitation_sum\"), api_key) }"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/download_country_DEM.html","id":null,"dir":"Reference","previous_headings":"","what":"Download 1km DEM Raster for Multiple Countries and Save to Files — download_country_DEM","title":"Download 1km DEM Raster for Multiple Countries and Save to Files — download_country_DEM","text":"function downloads 1km resolution DEM (Digital Elevation Model) raster data given vector ISO3 country codes, writes raster GeoTIFF file.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/download_country_DEM.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Download 1km DEM Raster for Multiple Countries and Save to Files — download_country_DEM","text":"","code":"download_country_DEM(PATHS, iso_codes, zoom_level = 6)"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/download_country_DEM.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Download 1km DEM Raster for Multiple Countries and Save to Files — download_country_DEM","text":"PATHS list containing paths DEM data saved. Typically generated get_paths() function include: DATA_DEM: Path directory DEM rasters saved. #' @param iso_codes character vector ISO3 country codes DEM data downloaded. zoom_level integer representing zoom level DEM data. Zoom levels 6-8 recommended 1km resolution (default = 6).","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/download_country_DEM.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Download 1km DEM Raster for Multiple Countries and Save to Files — download_country_DEM","text":"function return value. downloads DEM data country saves results GeoTIFF files specified directory.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/download_country_DEM.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Download 1km DEM Raster for Multiple Countries and Save to Files — download_country_DEM","text":"","code":"if (FALSE) { # Define the ISO3 country codes iso_codes <- c(\"ZAF\", \"KEN\", \"NGA\") # Get paths for data storage PATHS <- get_paths() # Download DEM rasters for the countries download_country_DEM(iso_codes, PATHS) }"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/est_WASH_coverage.html","id":null,"dir":"Reference","previous_headings":"","what":"Estimate and Visualize WASH Coverage and Correlation with Cholera Incidence — est_WASH_coverage","title":"Estimate and Visualize WASH Coverage and Correlation with Cholera Incidence — est_WASH_coverage","text":"function processes Water, Sanitation, Hygiene (WASH) coverage data African countries, optimizes weights WASH variables, calculates weighted means, examines correlation cholera incidence. function generates plots tables showing relationships saves results specified paths.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/est_WASH_coverage.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Estimate and Visualize WASH Coverage and Correlation with Cholera Incidence — est_WASH_coverage","text":"","code":"est_WASH_coverage(PATHS)"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/est_WASH_coverage.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Estimate and Visualize WASH Coverage and Correlation with Cholera Incidence — est_WASH_coverage","text":"PATHS list containing paths WASH data, figures, model inputs saved. Typically generated get_paths() function include: DATA_WASH: Path WASH data CSV file. DOCS_FIGURES: Path save output figures. MODEL_INPUT: Path save model input data. DOCS_TABLES: Path save tables used documentation.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/est_WASH_coverage.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Estimate and Visualize WASH Coverage and Correlation with Cholera Incidence — est_WASH_coverage","text":"function return value, generates saves plots CSV files showing WASH coverage estimates, optimized weights WASH variables, correlation cholera incidence.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/est_WASH_coverage.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Estimate and Visualize WASH Coverage and Correlation with Cholera Incidence — est_WASH_coverage","text":"WASH coverage data first normalized (0-1 scale). Risk-related WASH variables (unimproved water sources, surface water, unimproved sanitation, open defecation) converted protective factors taking complement (1 - value). , function: Optimizes weights WASH variable maximize correlation cholera incidence using L-BFGS-B method. Calculates weighted mean WASH variables country. Generates multiple plots showing relationships WASH variables cholera incidence. Saves tables optimized weights weighted mean WASH indices. Data Source: Sikder et al. (2023). Water, Sanitation, Hygiene Coverage Cholera Incidence Sub-Saharan Africa. doi:10.1021/acs.est.3c01317 .","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/est_WASH_coverage.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Estimate and Visualize WASH Coverage and Correlation with Cholera Incidence — est_WASH_coverage","text":"","code":"if (FALSE) { # Define paths for saving WASH data, figures, and tables PATHS <- get_paths() # Estimate WASH coverage and correlation with cholera incidence est_WASH_coverage(PATHS) }"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/est_immune_decay.html","id":null,"dir":"Reference","previous_headings":"","what":"Estimate Immune Decay — est_immune_decay","title":"Estimate Immune Decay — est_immune_decay","text":"function estimates immune durability fitting proportional decay model data. uses nonlinear least squares fitting (NLS) estimate decay parameters generates plots predicted immune durability decay rate distributions.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/est_immune_decay.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Estimate Immune Decay — est_immune_decay","text":"","code":"est_immune_decay(PATHS)"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/est_immune_decay.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Estimate Immune Decay — est_immune_decay","text":"PATHS list containing paths data figures saved. Typically generated get_paths() function include: DATA_IMMUNE_DURABILITY: Path directory containing immune durability data. DOCS_FIGURES: Path directory plots saved.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/est_immune_decay.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Estimate Immune Decay — est_immune_decay","text":"","code":"if (FALSE) { # Assuming PATHS is generated from get_paths() PATHS <- get_paths() est_immune_decay(PATHS) }"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/est_mobility.html","id":null,"dir":"Reference","previous_headings":"","what":"Fit Mobility Model Using Flight Data and Distance Matrices — est_mobility","title":"Fit Mobility Model Using Flight Data and Distance Matrices — est_mobility","text":"function estimates departure probability (tau_i) diffusion model (pi_ij) using flight data, distance matrices, population sizes. processes flight data, builds mobility distance matrices, fits mobility model, saves results CSV format.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/est_mobility.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Fit Mobility Model Using Flight Data and Distance Matrices — est_mobility","text":"","code":"est_mobility(PATHS)"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/est_mobility.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Fit Mobility Model Using Flight Data and Distance Matrices — est_mobility","text":"PATHS list containing paths data, models, figures stored. Typically generated get_paths() function include: DATA_OAG: Path directory containing flight data (OAG). DATA_SHAPEFILES: Path directory containing shapefiles African countries. DATA_DEMOGRAPHICS: Path directory containing demographic data. MODEL_INPUT: Path directory model input files saved. DOCS_FIGURES: Path directory figures saved.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/est_mobility.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Fit Mobility Model Using Flight Data and Distance Matrices — est_mobility","text":"function saves mobility matrices (M, D, N), travel probabilities (tau_j), diffusion matrices (pi_ij) CSV files specified directory. also generates saves visualizations PNG files.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/est_seasonal_dynamics.html","id":null,"dir":"Reference","previous_headings":"","what":"Estimate Seasonal Dynamics for Cholera and Precipitation Using Fourier Series — est_seasonal_dynamics","title":"Estimate Seasonal Dynamics for Cholera and Precipitation Using Fourier Series — est_seasonal_dynamics","text":"function retrieves historical precipitation data, processes cholera case data, fits seasonal dynamics models using double Fourier series. results saved CSV file, including parameter estimates, fitted values, processed data.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/est_seasonal_dynamics.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Estimate Seasonal Dynamics for Cholera and Precipitation Using Fourier Series — est_seasonal_dynamics","text":"","code":"est_seasonal_dynamics(PATHS)"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/est_seasonal_dynamics.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Estimate Seasonal Dynamics for Cholera and Precipitation Using Fourier Series — est_seasonal_dynamics","text":"PATHS list containing paths raw processed data stored. Typically generated get_paths() function include: DATA_CLIMATE: Path directory climate data stored. DATA_SHAPEFILES: Path directory containing country shapefiles. DATA_WHO_WEEKLY: Path directory containing cholera data. MODEL_INPUT: Path directory model input files saved.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/est_seasonal_dynamics.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Estimate Seasonal Dynamics for Cholera and Precipitation Using Fourier Series — est_seasonal_dynamics","text":"function saves parameter estimates, fitted values, processed data CSV file.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/est_symptomatic_prop.html","id":null,"dir":"Reference","previous_headings":"","what":"Estimate and Visualize Symptomatic Proportion Data — est_symptomatic_prop","title":"Estimate and Visualize Symptomatic Proportion Data — est_symptomatic_prop","text":"function reads symptomatic proportion data, fits Beta distribution simulate proportion infections symptomatic, generates visualizations comparing estimates previous studies.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/est_symptomatic_prop.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Estimate and Visualize Symptomatic Proportion Data — est_symptomatic_prop","text":"","code":"est_symptomatic_prop(PATHS)"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/est_symptomatic_prop.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Estimate and Visualize Symptomatic Proportion Data — est_symptomatic_prop","text":"PATHS list containing paths symptomatic proportion data figures saved. Typically generated get_paths() function include: DATA_PROCESSED: Path symptomatic proportion data. DOCS_FIGURES: Path save generated plots.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/est_symptomatic_prop.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Estimate and Visualize Symptomatic Proportion Data — est_symptomatic_prop","text":"function return value generates saves plots PNG file.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/est_symptomatic_prop.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Estimate and Visualize Symptomatic Proportion Data — est_symptomatic_prop","text":"","code":"if (FALSE) { # Estimate and visualize symptomatic proportion data PATHS <- get_paths() est_symptomatic_prop(PATHS) }"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/est_vaccine_effectiveness.html","id":null,"dir":"Reference","previous_headings":"","what":"Estimate Vaccine Effectiveness Decay Model — est_vaccine_effectiveness","title":"Estimate Vaccine Effectiveness Decay Model — est_vaccine_effectiveness","text":"function fits proportional decay model vaccine effectiveness data estimates parameters model, saving results CSV files. model assumes vaccine effectiveness decays time according proportional decay function. Additionally, fits beta distribution initial vaccine effectiveness capture uncertainty estimate.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/est_vaccine_effectiveness.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Estimate Vaccine Effectiveness Decay Model — est_vaccine_effectiveness","text":"","code":"est_vaccine_effectiveness(PATHS)"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/est_vaccine_effectiveness.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Estimate Vaccine Effectiveness Decay Model — est_vaccine_effectiveness","text":"PATHS list containing paths parameter data predictions saved. Typically generated get_paths() function include: MODEL_INPUT: Path directory parameter estimates predictions saved. DATA_VACCINE_EFFECTIVENESS: Path directory vaccine effectiveness data located.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/est_vaccine_effectiveness.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Estimate Vaccine Effectiveness Decay Model — est_vaccine_effectiveness","text":"function return values saves following CSV files: param_vaccine_effectiveness.csv: Parameter estimates initial vaccine effectiveness decay rate, including beta distribution parameters uncertainty. pred_vaccine_effectiveness.csv: Predicted vaccine effectiveness time (days vaccination).","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/est_vaccine_effectiveness.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Estimate Vaccine Effectiveness Decay Model — est_vaccine_effectiveness","text":"function uses non-linear least squares (NLS) approach, specifically Levenberg-Marquardt algorithm nls.lm function minpack.lm package, fit vaccine effectiveness decay model. model defined two parameters: \\(\\phi\\): Initial vaccine effectiveness time zero. \\(\\omega\\): Decay rate vaccine effectiveness time. standard errors parameter estimates extracted covariance matrix fitted model. Confidence intervals initial vaccine effectiveness used fit beta distribution capture uncertainty estimate. fitting model, function generates prediction vaccine effectiveness time saves predictions, along parameter estimates beta distribution parameters, CSV files specified MODEL_INPUT directory.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/est_vaccine_effectiveness.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Estimate Vaccine Effectiveness Decay Model — est_vaccine_effectiveness","text":"","code":"if (FALSE) { # Assuming PATHS is generated from get_paths() PATHS <- get_paths() # Estimate vaccine effectiveness and save results est_vaccine_effectiveness(PATHS) }"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/fourier_series_double.html","id":null,"dir":"Reference","previous_headings":"","what":"Fourier Series Model with Two Harmonics (Sine-Cosine Form) — fourier_series_double","title":"Fourier Series Model with Two Harmonics (Sine-Cosine Form) — fourier_series_double","text":"function implements generalized Fourier series model two harmonics sine-cosine form. model often used capture seasonal periodic dynamics time series data, temperature, precipitation, disease cases.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/fourier_series_double.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Fourier Series Model with Two Harmonics (Sine-Cosine Form) — fourier_series_double","text":"","code":"fourier_series_double(t, beta0, a1, b1, a2, b2, p)"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/fourier_series_double.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Fourier Series Model with Two Harmonics (Sine-Cosine Form) — fourier_series_double","text":"t numeric vector representing time points (e.g., day year week year). beta0 numeric value representing intercept term (fixed 0 default). a1 numeric value representing amplitude first cosine term (first harmonic). b1 numeric value representing amplitude first sine term (first harmonic). a2 numeric value representing amplitude second cosine term (second harmonic). b2 numeric value representing amplitude second sine term (second harmonic). p numeric value representing period seasonal cycle (e.g., 52 weekly data year).","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/fourier_series_double.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Fourier Series Model with Two Harmonics (Sine-Cosine Form) — fourier_series_double","text":"numeric vector predicted values based Fourier series model.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/fourier_series_double.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Fourier Series Model with Two Harmonics (Sine-Cosine Form) — fourier_series_double","text":"model defined follows: $$\\beta_t = \\beta_0 + a_1 \\cos\\left(\\frac{2 \\pi t}{p}\\right) + b_1 \\sin\\left(\\frac{2 \\pi t}{p}\\right) + a_2 \\cos\\left(\\frac{4 \\pi t}{p}\\right) + b_2 \\sin\\left(\\frac{4 \\pi t}{p}\\right)$$ model includes intercept term beta0 (set 0 default) two harmonics coefficients a1, b1, a2, b2. period p controls periodicity series. function based sine-cosine form Fourier series. details, see Wikipedia page Fourier series. function commonly used modeling seasonal dynamics environmental epidemiological data, periodic patterns observed.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/fourier_series_double.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Fourier Series Model with Two Harmonics (Sine-Cosine Form) — fourier_series_double","text":"","code":"if (FALSE) { # Example usage with weekly data (p = 52 weeks in a year) time_points <- 1:52 beta0 <- 0 a1 <- 1.5 b1 <- -0.5 a2 <- 0.8 b2 <- 0.3 p <- 52 predictions <- fourier_series_double(time_points, beta0, a1, b1, a2, b2, p) print(predictions) }"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/generate_country_grid_dist.html","id":null,"dir":"Reference","previous_headings":"","what":"Generate a Grid of Points Within a Country's Shapefile Based on Distance — generate_country_grid_dist","title":"Generate a Grid of Points Within a Country's Shapefile Based on Distance — generate_country_grid_dist","text":"function generates grid points within country's shapefile, points spaced specified distance kilometers.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/generate_country_grid_dist.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Generate a Grid of Points Within a Country's Shapefile Based on Distance — generate_country_grid_dist","text":"","code":"generate_country_grid_dist(country_shp, distance_km)"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/generate_country_grid_dist.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Generate a Grid of Points Within a Country's Shapefile Based on Distance — generate_country_grid_dist","text":"country_shp sf object representing country's shapefile. distance_km numeric value specifying distance (kilometers) grid points.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/generate_country_grid_dist.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Generate a Grid of Points Within a Country's Shapefile Based on Distance — generate_country_grid_dist","text":"sf object containing generated grid points within country boundary.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/generate_country_grid_dist.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Generate a Grid of Points Within a Country's Shapefile Based on Distance — generate_country_grid_dist","text":"function creates regular grid points within polygon defined country's shapefile, spaced according specified distance kilometers.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/generate_country_grid_dist.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Generate a Grid of Points Within a Country's Shapefile Based on Distance — generate_country_grid_dist","text":"","code":"if (FALSE) { # Example usage with distance in kilometers grid_points_sf <- generate_country_grid_dist(country_shapefile, distance_km = 50) }"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/generate_country_grid_n.html","id":null,"dir":"Reference","previous_headings":"","what":"Generate a Grid of Points Within a Country's Shapefile Based on Number of Points — generate_country_grid_n","title":"Generate a Grid of Points Within a Country's Shapefile Based on Number of Points — generate_country_grid_n","text":"function generates grid points within country's shapefile, grid contains specified number evenly spaced points.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/generate_country_grid_n.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Generate a Grid of Points Within a Country's Shapefile Based on Number of Points — generate_country_grid_n","text":"","code":"generate_country_grid_n(country_shp, n_points)"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/generate_country_grid_n.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Generate a Grid of Points Within a Country's Shapefile Based on Number of Points — generate_country_grid_n","text":"country_shp sf object representing country's shapefile. n_points numeric value specifying total number evenly spaced points generate within country boundary.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/generate_country_grid_n.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Generate a Grid of Points Within a Country's Shapefile Based on Number of Points — generate_country_grid_n","text":"sf object containing generated grid points within country boundary.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/generate_country_grid_n.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Generate a Grid of Points Within a Country's Shapefile Based on Number of Points — generate_country_grid_n","text":"function creates regular grid points within polygon defined country's shapefile, containing specified number points.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/generate_country_grid_n.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Generate a Grid of Points Within a Country's Shapefile Based on Number of Points — generate_country_grid_n","text":"","code":"if (FALSE) { # Example usage with a specified number of points grid_points_sf <- generate_country_grid_n(country_shapefile, n_points = 100) }"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_DMI_forecast.html","id":null,"dir":"Reference","previous_headings":"","what":"Get DMI (Dipole Mode Index) Forecast Data — get_DMI_forecast","title":"Get DMI (Dipole Mode Index) Forecast Data — get_DMI_forecast","text":"function retrieves manually extracted Dipole Mode Index (DMI) forecast data Bureau Meteorology's IOD forecast page.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_DMI_forecast.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get DMI (Dipole Mode Index) Forecast Data — get_DMI_forecast","text":"","code":"get_DMI_forecast()"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_DMI_forecast.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get DMI (Dipole Mode Index) Forecast Data — get_DMI_forecast","text":"data frame columns year, month (numeric), month_name, variable (DMI), value. DMI measure difference sea surface temperature anomalies western eastern Indian Ocean used describe Indian Ocean Dipole (IOD).","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_DMI_forecast.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Get DMI (Dipole Mode Index) Forecast Data — get_DMI_forecast","text":"IOD forecast manually extracted Bureau Meteorology's IOD forecast page: http://www.bom.gov.au/climate/ocean/outlooks/#region=IOD. data includes DMI values series months years, representing forecasts sea surface temperature anomalies. Negative DMI values indicate cooler waters west, positive DMI values indicate warmer waters west Indian Ocean.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_DMI_forecast.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get DMI (Dipole Mode Index) Forecast Data — get_DMI_forecast","text":"","code":"if (FALSE) { # Get the DMI forecast data dmi_forecast <- get_DMI_forecast() # Display the DMI forecast data print(dmi_forecast) }"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_DMI_historical.html","id":null,"dir":"Reference","previous_headings":"","what":"Download and Process Historical DMI Data — get_DMI_historical","title":"Download and Process Historical DMI Data — get_DMI_historical","text":"function downloads historical Dipole Mode Index (DMI) data NOAA processes data frame columns year, month (1-12), month_name, variable (DMI), value.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_DMI_historical.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Download and Process Historical DMI Data — get_DMI_historical","text":"","code":"get_DMI_historical()"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_DMI_historical.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Download and Process Historical DMI Data — get_DMI_historical","text":"data frame columns year, month, month_name, variable (DMI), value.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_DMI_historical.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Download and Process Historical DMI Data — get_DMI_historical","text":"DMI data downloaded NOAA's historical DMI data page: https://psl.noaa.gov/gcos_wgsp/Timeseries/Data/dmi..long.data. data includes DMI values representing difference sea surface temperature anomalies western eastern Indian Ocean.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_DMI_historical.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Download and Process Historical DMI Data — get_DMI_historical","text":"","code":"if (FALSE) { # Get the historical DMI data dmi_historical <- get_DMI_historical() # Display the historical DMI data print(dmi_historical) }"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_ENSO_forecast.html","id":null,"dir":"Reference","previous_headings":"","what":"Get ENSO (Niño3, Niño3.4, and Niño4) Forecast Data — get_ENSO_forecast","title":"Get ENSO (Niño3, Niño3.4, and Niño4) Forecast Data — get_ENSO_forecast","text":"function retrieves manually extracted ENSO forecast data, including Niño3, Niño3.4, Niño4 sea surface temperature (SST) anomalies, Bureau Meteorology.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_ENSO_forecast.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get ENSO (Niño3, Niño3.4, and Niño4) Forecast Data — get_ENSO_forecast","text":"","code":"get_ENSO_forecast()"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_ENSO_forecast.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get ENSO (Niño3, Niño3.4, and Niño4) Forecast Data — get_ENSO_forecast","text":"data frame columns year, month (numeric), month_name, variable (ENSO3, ENSO34, ENSO4), value.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_ENSO_forecast.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Get ENSO (Niño3, Niño3.4, and Niño4) Forecast Data — get_ENSO_forecast","text":"ENSO forecast manually extracted Bureau Meteorology's ocean outlook page. data includes SST anomalies Niño3, Niño3.4, Niño4 regions. Negative values indicate cooler sea surface temperatures, positive values indicate warmer temperatures.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_ENSO_forecast.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get ENSO (Niño3, Niño3.4, and Niño4) Forecast Data — get_ENSO_forecast","text":"","code":"if (FALSE) { # Get the ENSO forecast data enso_forecast <- get_ENSO_forecast() # Display the ENSO forecast data print(enso_forecast) }"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_ENSO_historical.html","id":null,"dir":"Reference","previous_headings":"","what":"Download and Process Historical ENSO Data (Niño3, Niño3.4, Niño4) — get_ENSO_historical","title":"Download and Process Historical ENSO Data (Niño3, Niño3.4, Niño4) — get_ENSO_historical","text":"function downloads historical ENSO data Niño3, Niño3.4, Niño4 NOAA processes single data frame columns year (integer), month, month_name, variable (ENSO3, ENSO34, ENSO4), value.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_ENSO_historical.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Download and Process Historical ENSO Data (Niño3, Niño3.4, Niño4) — get_ENSO_historical","text":"","code":"get_ENSO_historical()"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_ENSO_historical.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Download and Process Historical ENSO Data (Niño3, Niño3.4, Niño4) — get_ENSO_historical","text":"data frame columns year, month, month_name, variable, value.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_ENSO_historical.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Download and Process Historical ENSO Data (Niño3, Niño3.4, Niño4) — get_ENSO_historical","text":"historical ENSO data downloaded NOAA's historical ENSO data pages. data includes sea surface temperature anomalies Niño3, Niño3.4, Niño4 regions.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_ENSO_historical.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Download and Process Historical ENSO Data (Niño3, Niño3.4, Niño4) — get_ENSO_historical","text":"","code":"if (FALSE) { # Get the historical ENSO data enso_historical <- get_ENSO_historical() # Display the historical ENSO data print(enso_historical) }"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_WASH_data.html","id":null,"dir":"Reference","previous_headings":"","what":"Download, Process, and Save WASH Coverage Data — get_WASH_data","title":"Download, Process, and Save WASH Coverage Data — get_WASH_data","text":"function processes WASH (Water, Sanitation, Hygiene) coverage data African countries Sikder et al. (2023). data includes indicators water sanitation access, including piped water, improved sanitation, unimproved water sources, open defecation. processed data saved CSV file specified path.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_WASH_data.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Download, Process, and Save WASH Coverage Data — get_WASH_data","text":"","code":"get_WASH_data(PATHS)"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_WASH_data.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Download, Process, and Save WASH Coverage Data — get_WASH_data","text":"PATHS list containing paths WASH data saved. Typically generated get_paths() function include: DATA_WASH: Path directory processed WASH data saved.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_WASH_data.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Download, Process, and Save WASH Coverage Data — get_WASH_data","text":"function return value processes WASH coverage data saves specified directory CSV file.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_WASH_data.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Download, Process, and Save WASH Coverage Data — get_WASH_data","text":"WASH coverage data based percentages population access piped water, improved water sources, septic sewer sanitation, improved sanitation. data also includes proportions population using unimproved water sources, surface water, unimproved sanitation, practicing open defecation. risk-related variables (unimproved water, surface water, unimproved sanitation, open defecation) converted complement (1 - value) reflect protective factors. data scaled 0 1. Data Source: Sikder et al. (2023). Water, Sanitation, Hygiene Coverage Cholera Incidence Sub-Saharan Africa. doi:10.1021/acs.est.3c01317 .","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_WASH_data.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Download, Process, and Save WASH Coverage Data — get_WASH_data","text":"","code":"if (FALSE) { # Define paths for saving WASH data PATHS <- get_paths() # Download, process, and save WASH coverage data get_WASH_data(PATHS) }"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_centroid.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate the Centroid of a Country from its Shapefile — get_centroid","title":"Calculate the Centroid of a Country from its Shapefile — get_centroid","text":"function reads country shapefile, calculates centroid, returns centroid coordinates (longitude latitude) along ISO3 country code.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_centroid.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate the Centroid of a Country from its Shapefile — get_centroid","text":"","code":"get_centroid(shapefile)"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_centroid.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate the Centroid of a Country from its Shapefile — get_centroid","text":"shapefile character string representing file path country shapefile (.shp format).","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_centroid.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculate the Centroid of a Country from its Shapefile — get_centroid","text":"data frame following columns: iso3: ISO3 country code extracted shapefile name. lon: longitude country's centroid. lat: latitude country's centroid.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_centroid.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Calculate the Centroid of a Country from its Shapefile — get_centroid","text":"function reads shapefile using sf::st_read(), calculates centroid country using sf::st_centroid(), extracts coordinates centroid sf::st_coordinates(). ISO3 code extracted filename shapefile, assuming first three characters shapefile name represent ISO3 country code.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_centroid.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Calculate the Centroid of a Country from its Shapefile — get_centroid","text":"","code":"if (FALSE) { # Example usage: # Assuming you have a shapefile \"ZAF_ADM0.shp\" for South Africa shapefile_path <- \"path/to/shapefile/ZAF_ADM0.shp\" centroid_data <- get_centroid(shapefile_path) print(centroid_data) }"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_climate_forecast.html","id":null,"dir":"Reference","previous_headings":"","what":"Get Climate Forecast Data (Daily) — get_climate_forecast","title":"Get Climate Forecast Data (Daily) — get_climate_forecast","text":"function retrieves daily climate forecast data specified location one climate variables range forecast days using Open-Meteo API.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_climate_forecast.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get Climate Forecast Data (Daily) — get_climate_forecast","text":"","code":"get_climate_forecast(lat, lon, n_days, climate_variables, api_key = NULL)"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_climate_forecast.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get Climate Forecast Data (Daily) — get_climate_forecast","text":"lat numeric value representing latitude location. lon numeric value representing longitude location. n_days integer representing number forecast days retrieve (maximum value 15). climate_variables character vector climate variables retrieve (e.g., c(\"temperature_2m_max\", \"precipitation_sum\")). api_key character string representing API key Open-Meteo API.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_climate_forecast.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get Climate Forecast Data (Daily) — get_climate_forecast","text":"data frame columns: date date forecast (class Date). climate_variable name climate variable. climate_value value climate variable date.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_climate_forecast.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Get Climate Forecast Data (Daily) — get_climate_forecast","text":"function queries Open-Meteo API daily weather forecast data specified latitude, longitude, range forecast days (15 days). API request successful, function returns data frame containing date, climate variable, value. request fails, function returns NULL issues warning HTTP status code.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_climate_forecast.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get Climate Forecast Data (Daily) — get_climate_forecast","text":"","code":"if (FALSE) { # Example usage to get forecast data for multiple climate variables lat <- 52.52 lon <- 13.41 n_days <- 15 climate_variables <- c(\"temperature_2m_max\", \"precipitation_sum\") api_key <- \"your_api_key_here\" forecast_data <- get_climate_forecast(lat, lon, n_days, climate_variables, api_key) print(forecast_data) }"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_climate_future.html","id":null,"dir":"Reference","previous_headings":"","what":"Download Future Climate Data for Multiple Locations (One Model at a Time) — get_climate_future","title":"Download Future Climate Data for Multiple Locations (One Model at a Time) — get_climate_future","text":"function retrieves daily future climate data multiple specified locations climate variables specified date range using specified climate model.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_climate_future.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Download Future Climate Data for Multiple Locations (One Model at a Time) — get_climate_future","text":"","code":"get_climate_future( lat, lon, date_start, date_stop, climate_variables, climate_model, api_key = NULL )"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_climate_future.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Download Future Climate Data for Multiple Locations (One Model at a Time) — get_climate_future","text":"lat numeric vector representing latitudes locations. lon numeric vector representing longitudes locations. date_start character string representing start date data \"YYYY-MM-DD\" format. date_stop character string representing end date data \"YYYY-MM-DD\" format. climate_variables character vector climate variables retrieve. Valid options include: temperature_2m_mean: Mean 2m air temperature. temperature_2m_max: Maximum 2m air temperature. temperature_2m_min: Minimum 2m air temperature. wind_speed_10m_mean: Mean 10m wind speed. wind_speed_10m_max: Maximum 10m wind speed. cloud_cover_mean: Mean cloud cover. shortwave_radiation_sum: Sum shortwave radiation. relative_humidity_2m_mean: Mean 2m relative humidity. relative_humidity_2m_max: Maximum 2m relative humidity. relative_humidity_2m_min: Minimum 2m relative humidity. dew_point_2m_mean: Mean 2m dew point temperature. dew_point_2m_min: Minimum 2m dew point temperature. dew_point_2m_max: Maximum 2m dew point temperature. precipitation_sum: Total precipitation. rain_sum: Total rainfall. snowfall_sum: Total snowfall. pressure_msl_mean: Mean sea level pressure. soil_moisture_0_to_10cm_mean: Mean soil moisture (0-10 cm depth). et0_fao_evapotranspiration_sum: Sum evapotranspiration (FAO standard). climate_model single character string representing climate model use. Available models include: CMCC_CM2_VHR4 FGOALS_f3_H HiRAM_SIT_HR MRI_AGCM3_2_S EC_Earth3P_HR MPI_ESM1_2_XR NICAM16_8S api_key character string representing API key climate data API. provided, function assumes API key required.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_climate_future.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Download Future Climate Data for Multiple Locations (One Model at a Time) — get_climate_future","text":"data frame columns: date: date climate data. latitude: latitude location. longitude: longitude location. climate_model: climate model used data. variable_name: climate variable retrieved (e.g., temperature_2m_mean, precipitation_sum). value: value climate variable date.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_climate_future.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Download Future Climate Data for Multiple Locations (One Model at a Time) — get_climate_future","text":"function retrieves daily future climate data multiple specified locations using Open-Meteo Climate API. downloads specified climate variables latitude longitude provided, using single climate model. data retrieved date range specified date_start date_stop. progress bar displayed indicate download progress.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_climate_future.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Download Future Climate Data for Multiple Locations (One Model at a Time) — get_climate_future","text":"","code":"if (FALSE) { # Define latitudes and longitudes for the locations lat <- c(40.7128, 34.0522) lon <- c(-74.0060, -118.2437) # Define the climate variables and model climate_vars <- c(\"temperature_2m_mean\", \"precipitation_sum\") climate_model <- \"MRI_AGCM3_2_S\" # Set the date range and API key date_start <- \"2023-01-01\" date_stop <- \"2030-12-31\" api_key <- \"your_api_key_here\" # Download the climate data climate_data <- get_climate_future(lat, lon, date_start, date_stop, climate_vars, climate_model, api_key) # Display the climate data head(climate_data) }"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_climate_historical.html","id":null,"dir":"Reference","previous_headings":"","what":"Get Historical Climate Data — get_climate_historical","title":"Get Historical Climate Data — get_climate_historical","text":"function retrieves historical weather data specified location one climate variables date range. uses Open-Meteo API.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_climate_historical.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get Historical Climate Data — get_climate_historical","text":"","code":"get_climate_historical( lat, lon, start_date, end_date, climate_variables, api_key = NULL )"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_climate_historical.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get Historical Climate Data — get_climate_historical","text":"lat numeric value representing latitude location. lon numeric value representing longitude location. start_date character string representing start date \"YYYY-MM-DD\" format. end_date character string representing end date \"YYYY-MM-DD\" format. climate_variables character vector climate variables retrieve (e.g., c(\"precipitation_sum\", \"temperature_2m_max\")). api_key character string representing API key Open-Meteo API. provided, default key used.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_climate_historical.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get Historical Climate Data — get_climate_historical","text":"data frame columns: date date observation (class Date). climate_variable name climate variable. climate_value value climate variable date.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_climate_historical.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Get Historical Climate Data — get_climate_historical","text":"function queries Open-Meteo API historical weather data given latitude, longitude, climate variables specified date range. API request successful, function returns data frame containing date, climate variable, value. request fails, function returns NULL issues warning HTTP status code.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_climate_historical.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get Historical Climate Data — get_climate_historical","text":"","code":"if (FALSE) { # Example usage to get historical data for multiple climate variables lat <- 40.7128 lon <- -74.0060 start_date <- \"2020-01-01\" end_date <- \"2020-12-31\" climate_variables <- c(\"temperature_2m_max\", \"precipitation_sum\") api_key <- \"your_api_key_here\" # Replace with your actual API key climate_data <- get_climate_historical(lat, lon, start_date, end_date, climate_variables, api_key) print(climate_data) }"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_country_shp.html","id":null,"dir":"Reference","previous_headings":"","what":"Get a country shapefile from GeoBoundaries API — get_country_shp","title":"Get a country shapefile from GeoBoundaries API — get_country_shp","text":"function retrieves shapefile given iso3 code GeoBoundaries data API.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_country_shp.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get a country shapefile from GeoBoundaries API — get_country_shp","text":"","code":"get_country_shp(iso3, path_output = NULL)"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_country_shp.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get a country shapefile from GeoBoundaries API — get_country_shp","text":"iso3 three-letter capitalized character string. Must follow ISO-3166 Alpha-3 country code standard (https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3). path_output file path save country shapefile","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_country_shp.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get a country shapefile from GeoBoundaries API — get_country_shp","text":"sf class shapefile","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_country_shp.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get a country shapefile from GeoBoundaries API — get_country_shp","text":"","code":"if (FALSE) { tmp <- get_country_shp(iso3 = 'MCO') plot(tmp) }"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_elevation.html","id":null,"dir":"Reference","previous_headings":"","what":"Get Mean or Median Elevation from Downloaded DEM Data Using Country Boundaries — get_elevation","title":"Get Mean or Median Elevation from Downloaded DEM Data Using Country Boundaries — get_elevation","text":"function calculates mean median elevation given set ISO3 country codes loading downloaded DEM files extracting raster values within country's boundary.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_elevation.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get Mean or Median Elevation from Downloaded DEM Data Using Country Boundaries — get_elevation","text":"","code":"get_elevation(PATHS, iso_codes, method = \"median\")"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_elevation.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get Mean or Median Elevation from Downloaded DEM Data Using Country Boundaries — get_elevation","text":"PATHS list containing paths DEM data stored. Typically generated get_paths() function include: DATA_DEM: Path directory DEM rasters saved (GeoTIFF format). DATA_SHAPEFILES: Path directory shapefiles saved. iso_codes character vector ISO3 country codes elevation data calculated. method character string specifying method use calculating elevation statistics. Can \"mean\" \"median\" (default \"median\").","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_elevation.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get Mean or Median Elevation from Downloaded DEM Data Using Country Boundaries — get_elevation","text":"data frame ISO3 codes, country names, calculated mean median elevation country.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_elevation.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get Mean or Median Elevation from Downloaded DEM Data Using Country Boundaries — get_elevation","text":"","code":"if (FALSE) { # Define the ISO3 country codes iso_codes <- c(\"ZAF\", \"KEN\", \"NGA\") # Get paths for data storage PATHS <- get_paths() # Calculate mean elevation for the countries mean_elevations <- get_elevation(iso_codes, PATHS, method = \"mean\") print(mean_elevations) }"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_generation_time_distribution.html","id":null,"dir":"Reference","previous_headings":"","what":"Estimate the Generation Time Distribution for Days and Weeks — get_generation_time_distribution","title":"Estimate the Generation Time Distribution for Days and Weeks — get_generation_time_distribution","text":"function generates probability distribution generation time cholera based gamma distribution. allows specification mean generation time, adjusts shape rate parameters. day-wise week-wise probabilities saved CSV files.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_generation_time_distribution.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Estimate the Generation Time Distribution for Days and Weeks — get_generation_time_distribution","text":"","code":"get_generation_time_distribution(PATHS, mean_generation_time)"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_generation_time_distribution.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Estimate the Generation Time Distribution for Days and Weeks — get_generation_time_distribution","text":"PATHS list containing paths output tables saved. Typically generated get_paths() function include: MODEL_INPUT: Path directory model input data saved. DOCS_TABLES: Path directory day-wise week-wise generation time tables saved. mean_generation_time numeric value representing desired mean generation time (days). value used adjust shape rate parameters gamma distribution.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_ggplot_legend.html","id":null,"dir":"Reference","previous_headings":"","what":"Extract the Legend from a ggplot Object — get_ggplot_legend","title":"Extract the Legend from a ggplot Object — get_ggplot_legend","text":"function extracts legend ggplot object returns grob (graphical object). extracted legend can used independently, instance, combine legend plots.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_ggplot_legend.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Extract the Legend from a ggplot Object — get_ggplot_legend","text":"","code":"get_ggplot_legend(plot)"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_ggplot_legend.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Extract the Legend from a ggplot Object — get_ggplot_legend","text":"plot ggplot object legend extracted.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_ggplot_legend.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Extract the Legend from a ggplot Object — get_ggplot_legend","text":"grob representing legend ggplot object.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_ggplot_legend.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Extract the Legend from a ggplot Object — get_ggplot_legend","text":"function converts ggplot object grob using ggplotGrob() extracts legend, stored grob name \"guide-box\". function can used separate legend plot combine plots needed.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_ggplot_legend.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Extract the Legend from a ggplot Object — get_ggplot_legend","text":"","code":"# Create a simple ggplot object p <- ggplot2::ggplot(mtcars, ggplot2::aes(x = wt, y = mpg, color = factor(gear))) + ggplot2::geom_point() + ggplot2::scale_color_discrete(name = \"Gear\") # Extract the legend from the plot legend <- get_ggplot_legend(p) # Display the extracted legend grid::grid.draw(legend)"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_immune_decay_data.html","id":null,"dir":"Reference","previous_headings":"","what":"Get Immune Decay Data — get_immune_decay_data","title":"Get Immune Decay Data — get_immune_decay_data","text":"function retrieves immune durability data based known values various studies. data includes time (days), effectiveness, confidence intervals studies.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_immune_decay_data.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get Immune Decay Data — get_immune_decay_data","text":"","code":"get_immune_decay_data(PATHS)"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_immune_decay_data.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get Immune Decay Data — get_immune_decay_data","text":"PATHS list containing paths data figures saved. Typically generated get_paths() function include: DATA_IMMUNE_DURABILITY: Path directory immune durability data saved.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_immune_decay_data.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get Immune Decay Data — get_immune_decay_data","text":"data frame columns: day, effectiveness, effectiveness_hi, effectiveness_lo, source.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_immune_decay_data.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get Immune Decay Data — get_immune_decay_data","text":"","code":"if (FALSE) { # Assuming PATHS is generated from get_paths() PATHS <- get_paths() immune_data <- get_immune_decay_data(PATHS) print(immune_data) }"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_paths.html","id":null,"dir":"Reference","previous_headings":"","what":"Generate Directory Paths for the MOSAIC Project — get_paths","title":"Generate Directory Paths for the MOSAIC Project — get_paths","text":"get_paths() function generates structured list file paths different data document directories MOSAIC project, based provided root directory.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_paths.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Generate Directory Paths for the MOSAIC Project — get_paths","text":"","code":"get_paths(root = NULL)"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_paths.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Generate Directory Paths for the MOSAIC Project — get_paths","text":"root string specifying root directory MOSAIC project. paths generated relative root.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_paths.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Generate Directory Paths for the MOSAIC Project — get_paths","text":"named list containing following paths: ROOT root directory provided user. DATA_RAW Path raw data directory (\"MOSAIC-data/data/raw\"). DATA_PROCESSED Path processed data directory (\"MOSAIC-data/data/processed\"). MODEL_INPUT NULL, reserved path model input (applicable). MODEL_OUTPUT NULL, reserved path model output (applicable). DOCS_FIGURES Path figures directory (\"MOSAIC-docs/figures\"). DOCS_TABLES Path tables directory (\"MOSAIC-docs/tables\"). DOCS_PARAMS Path parameters directory (\"MOSAIC-docs/parameters\").","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_paths.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Generate Directory Paths for the MOSAIC Project — get_paths","text":"function helps organize directory structure data document storage MOSAIC project generating paths raw data, processed data, figures, tables, parameters. paths returned named list can used streamline access various project-related directories.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_paths.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Generate Directory Paths for the MOSAIC Project — get_paths","text":"","code":"if (FALSE) { root_dir <- \"/{full file path}/MOSAIC\" PATHS <- get_paths(root_dir) print(PATHS$DATA_RAW) }"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_suspected_cases.html","id":null,"dir":"Reference","previous_headings":"","what":"Get Proportion of Suspected Cholera Cases and Save Parameter Data Frame — get_suspected_cases","title":"Get Proportion of Suspected Cholera Cases and Save Parameter Data Frame — get_suspected_cases","text":"function generates parameters proportion suspected cholera cases (rho) saves parameter data frame.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_suspected_cases.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get Proportion of Suspected Cholera Cases and Save Parameter Data Frame — get_suspected_cases","text":"","code":"get_suspected_cases(PATHS)"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_suspected_cases.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get Proportion of Suspected Cholera Cases and Save Parameter Data Frame — get_suspected_cases","text":"PATHS list containing paths parameter data saved. Typically generated get_paths() function include: MODEL_INPUT: Path directory parameter data frame saved.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_suspected_cases.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get Proportion of Suspected Cholera Cases and Save Parameter Data Frame — get_suspected_cases","text":"data frame containing parameter values proportion suspected cholera cases (rho).","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_symptomatic_prop_data.html","id":null,"dir":"Reference","previous_headings":"","what":"Get Symptomatic Proportion Data — get_symptomatic_prop_data","title":"Get Symptomatic Proportion Data — get_symptomatic_prop_data","text":"function creates data frame studies reporting proportion cholera infections symptomatic saves CSV file.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_symptomatic_prop_data.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get Symptomatic Proportion Data — get_symptomatic_prop_data","text":"","code":"get_symptomatic_prop_data(PATHS)"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_symptomatic_prop_data.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get Symptomatic Proportion Data — get_symptomatic_prop_data","text":"PATHS list containing paths symptomatic proportion data saved. Typically generated get_paths() function include: DATA_PROCESSED: Path save symptomatic proportion data.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_symptomatic_prop_data.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get Symptomatic Proportion Data — get_symptomatic_prop_data","text":"function return value saves data frame CSV file.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_symptomatic_prop_data.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get Symptomatic Proportion Data — get_symptomatic_prop_data","text":"","code":"if (FALSE) { # Generate and save symptomatic proportion data PATHS <- get_paths() get_symptomatic_prop_data(PATHS) }"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_vaccine_effectiveness_data.html","id":null,"dir":"Reference","previous_headings":"","what":"Get Vaccine Effectiveness Data — get_vaccine_effectiveness_data","title":"Get Vaccine Effectiveness Data — get_vaccine_effectiveness_data","text":"function saves dataset containing vaccine effectiveness data extracted multiple studies. data saved CSV file.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_vaccine_effectiveness_data.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get Vaccine Effectiveness Data — get_vaccine_effectiveness_data","text":"","code":"get_vaccine_effectiveness_data(PATHS)"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/get_vaccine_effectiveness_data.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get Vaccine Effectiveness Data — get_vaccine_effectiveness_data","text":"PATHS list containing paths data saved. Typically generated get_paths() function include: DATA_VACCINE_EFFECTIVENESS: Path directory vaccine effectiveness data saved.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/iso_codes_africa.html","id":null,"dir":"Reference","previous_headings":"","what":"ISO3 Country Codes for All African Countries — iso_codes_africa","title":"ISO3 Country Codes for All African Countries — iso_codes_africa","text":"character vector containing ISO3 country codes 54 countries Africa.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/iso_codes_africa.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ISO3 Country Codes for All African Countries — iso_codes_africa","text":"","code":"iso_codes_africa"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/iso_codes_africa.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"ISO3 Country Codes for All African Countries — iso_codes_africa","text":"character vector ISO3 country codes.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/iso_codes_africa.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"ISO3 Country Codes for All African Countries — iso_codes_africa","text":"","code":"# Access ISO3 codes for all African countries iso_codes_africa #> [1] \"DZA\" \"AGO\" \"BEN\" \"BWA\" \"BFA\" \"BDI\" \"CPV\" \"CMR\" \"CAF\" \"TCD\" \"COM\" \"COG\" #> [13] \"COD\" \"CIV\" \"DJI\" \"EGY\" \"GNQ\" \"ERI\" \"SWZ\" \"ETH\" \"GAB\" \"GMB\" \"GHA\" \"GIN\" #> [25] \"GNB\" \"KEN\" \"LSO\" \"LBR\" \"LBY\" \"MDG\" \"MWI\" \"MLI\" \"MRT\" \"MUS\" \"MAR\" \"MOZ\" #> [37] \"NAM\" \"NER\" \"NGA\" \"RWA\" \"STP\" \"SEN\" \"SYC\" \"SLE\" \"SOM\" \"ZAF\" \"SSD\" \"SDN\" #> [49] \"TGO\" \"TUN\" \"UGA\" \"TZA\" \"ZMB\" \"ZWE\""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/iso_codes_africa_central.html","id":null,"dir":"Reference","previous_headings":"","what":"ISO3 Country Codes for Central African Countries — iso_codes_africa_central","title":"ISO3 Country Codes for Central African Countries — iso_codes_africa_central","text":"character vector containing ISO3 country codes 8 countries Central Africa.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/iso_codes_africa_central.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ISO3 Country Codes for Central African Countries — iso_codes_africa_central","text":"","code":"iso_codes_africa_central"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/iso_codes_africa_central.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"ISO3 Country Codes for Central African Countries — iso_codes_africa_central","text":"character vector ISO3 country codes.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/iso_codes_africa_central.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"ISO3 Country Codes for Central African Countries — iso_codes_africa_central","text":"","code":"# Access ISO3 codes for Central African countries iso_codes_africa_central #> [1] \"AGO\" \"CAF\" \"TCD\" \"COG\" \"COD\" \"GNQ\" \"GAB\" \"STP\""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/iso_codes_africa_east.html","id":null,"dir":"Reference","previous_headings":"","what":"ISO3 Country Codes for East African Countries — iso_codes_africa_east","title":"ISO3 Country Codes for East African Countries — iso_codes_africa_east","text":"character vector containing ISO3 country codes 14 countries East Africa.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/iso_codes_africa_east.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ISO3 Country Codes for East African Countries — iso_codes_africa_east","text":"","code":"iso_codes_africa_east"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/iso_codes_africa_east.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"ISO3 Country Codes for East African Countries — iso_codes_africa_east","text":"character vector ISO3 country codes.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/iso_codes_africa_east.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"ISO3 Country Codes for East African Countries — iso_codes_africa_east","text":"","code":"# Access ISO3 codes for East African countries iso_codes_africa_east #> [1] \"BDI\" \"COM\" \"DJI\" \"ERI\" \"ETH\" \"KEN\" \"MDG\" \"MWI\" \"RWA\" \"SYC\" \"SOM\" \"SSD\" #> [13] \"TZA\" \"UGA\""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/iso_codes_africa_north.html","id":null,"dir":"Reference","previous_headings":"","what":"ISO3 Country Codes for North African Countries — iso_codes_africa_north","title":"ISO3 Country Codes for North African Countries — iso_codes_africa_north","text":"character vector containing ISO3 country codes 6 countries North Africa.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/iso_codes_africa_north.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ISO3 Country Codes for North African Countries — iso_codes_africa_north","text":"","code":"iso_codes_africa_north"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/iso_codes_africa_north.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"ISO3 Country Codes for North African Countries — iso_codes_africa_north","text":"character vector ISO3 country codes.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/iso_codes_africa_north.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"ISO3 Country Codes for North African Countries — iso_codes_africa_north","text":"","code":"# Access ISO3 codes for North African countries iso_codes_africa_north #> [1] \"DZA\" \"EGY\" \"LBY\" \"MAR\" \"SDN\" \"TUN\""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/iso_codes_africa_south.html","id":null,"dir":"Reference","previous_headings":"","what":"ISO3 Country Codes for Southern African Countries — iso_codes_africa_south","title":"ISO3 Country Codes for Southern African Countries — iso_codes_africa_south","text":"character vector containing ISO3 country codes 7 countries Southern Africa.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/iso_codes_africa_south.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ISO3 Country Codes for Southern African Countries — iso_codes_africa_south","text":"","code":"iso_codes_africa_south"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/iso_codes_africa_south.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"ISO3 Country Codes for Southern African Countries — iso_codes_africa_south","text":"character vector ISO3 country codes.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/iso_codes_africa_south.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"ISO3 Country Codes for Southern African Countries — iso_codes_africa_south","text":"","code":"# Access ISO3 codes for Southern African countries iso_codes_africa_south #> [1] \"BWA\" \"LSO\" \"NAM\" \"ZAF\" \"SWZ\" \"ZMB\" \"ZWE\""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/iso_codes_africa_west.html","id":null,"dir":"Reference","previous_headings":"","what":"ISO3 Country Codes for West African Countries — iso_codes_africa_west","title":"ISO3 Country Codes for West African Countries — iso_codes_africa_west","text":"character vector containing ISO3 country codes 16 countries West Africa.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/iso_codes_africa_west.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ISO3 Country Codes for West African Countries — iso_codes_africa_west","text":"","code":"iso_codes_africa_west"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/iso_codes_africa_west.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"ISO3 Country Codes for West African Countries — iso_codes_africa_west","text":"character vector ISO3 country codes.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/iso_codes_africa_west.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"ISO3 Country Codes for West African Countries — iso_codes_africa_west","text":"","code":"# Access ISO3 codes for West African countries iso_codes_africa_west #> [1] \"BEN\" \"BFA\" \"CPV\" \"CIV\" \"GMB\" \"GHA\" \"GIN\" \"GNB\" \"LBR\" \"MLI\" \"MRT\" \"NER\" #> [13] \"NGA\" \"SEN\" \"SLE\" \"TGO\""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/iso_codes_mosaic.html","id":null,"dir":"Reference","previous_headings":"","what":"ISO3 Country Codes for MOSAIC Modeling Framework — iso_codes_mosaic","title":"ISO3 Country Codes for MOSAIC Modeling Framework — iso_codes_mosaic","text":"character vector containing ISO3 country codes 40 countries modeled MOSAIC framework.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/iso_codes_mosaic.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ISO3 Country Codes for MOSAIC Modeling Framework — iso_codes_mosaic","text":"","code":"iso_codes_mosaic"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/iso_codes_mosaic.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"ISO3 Country Codes for MOSAIC Modeling Framework — iso_codes_mosaic","text":"character vector ISO3 country codes.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/iso_codes_mosaic.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"ISO3 Country Codes for MOSAIC Modeling Framework — iso_codes_mosaic","text":"","code":"# Access ISO3 codes for countries modeled in the MOSAIC framework iso_codes_mosaic #> [1] \"AGO\" \"BEN\" \"BWA\" \"BFA\" \"BDI\" \"CMR\" \"CAF\" \"TCD\" \"COG\" \"COD\" \"CIV\" \"GNQ\" #> [13] \"ERI\" \"SWZ\" \"ETH\" \"GAB\" \"GMB\" \"GHA\" \"GIN\" \"GNB\" \"KEN\" \"LSO\" \"LBR\" \"MWI\" #> [25] \"MLI\" \"MRT\" \"MOZ\" \"NAM\" \"NER\" \"NGA\" \"RWA\" \"SEN\" \"SLE\" \"SOM\" \"ZAF\" \"SSD\" #> [37] \"TGO\" \"UGA\" \"TZA\" \"ZMB\" \"ZWE\""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/iso_codes_ssa.html","id":null,"dir":"Reference","previous_headings":"","what":"ISO3 Country Codes for Sub-Saharan African Countries — iso_codes_ssa","title":"ISO3 Country Codes for Sub-Saharan African Countries — iso_codes_ssa","text":"character vector containing ISO3 country codes 48 countries Sub-Saharan Africa.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/iso_codes_ssa.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ISO3 Country Codes for Sub-Saharan African Countries — iso_codes_ssa","text":"","code":"iso_codes_ssa"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/iso_codes_ssa.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"ISO3 Country Codes for Sub-Saharan African Countries — iso_codes_ssa","text":"character vector ISO3 country codes.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/iso_codes_ssa.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"ISO3 Country Codes for Sub-Saharan African Countries — iso_codes_ssa","text":"","code":"# Access ISO3 codes for Sub-Saharan African countries iso_codes_ssa #> [1] \"AGO\" \"BEN\" \"BWA\" \"BFA\" \"BDI\" \"CMR\" \"CPV\" \"CAF\" \"TCD\" \"COM\" \"COG\" \"COD\" #> [13] \"CIV\" \"DJI\" \"GNQ\" \"ERI\" \"SWZ\" \"ETH\" \"GAB\" \"GMB\" \"GHA\" \"GIN\" \"GNB\" \"KEN\" #> [25] \"LSO\" \"LBR\" \"MDG\" \"MWI\" \"MLI\" \"MRT\" \"MUS\" \"MOZ\" \"NAM\" \"NER\" \"NGA\" \"RWA\" #> [37] \"STP\" \"SEN\" \"SYC\" \"SLE\" \"SOM\" \"ZAF\" \"SSD\" \"SDN\" \"TGO\" \"UGA\" \"TZA\" \"ZMB\" #> [49] \"ZWE\""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/iso_codes_who_afro.html","id":null,"dir":"Reference","previous_headings":"","what":"ISO3 Country Codes for WHO AFRO Region Countries — iso_codes_who_afro","title":"ISO3 Country Codes for WHO AFRO Region Countries — iso_codes_who_afro","text":"character vector containing ISO3 country codes 47 countries African Region (AFRO).","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/iso_codes_who_afro.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ISO3 Country Codes for WHO AFRO Region Countries — iso_codes_who_afro","text":"","code":"iso_codes_who_afro"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/iso_codes_who_afro.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"ISO3 Country Codes for WHO AFRO Region Countries — iso_codes_who_afro","text":"character vector ISO3 country codes.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/iso_codes_who_afro.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"ISO3 Country Codes for WHO AFRO Region Countries — iso_codes_who_afro","text":"","code":"# Access ISO3 codes for WHO AFRO Region countries iso_codes_who_afro #> [1] \"DZA\" \"AGO\" \"BEN\" \"BWA\" \"BFA\" \"BDI\" \"CPV\" \"CMR\" \"CAF\" \"TCD\" \"COM\" \"COG\" #> [13] \"COD\" \"CIV\" \"DJI\" \"GNQ\" \"ERI\" \"SWZ\" \"ETH\" \"GAB\" \"GMB\" \"GHA\" \"GIN\" \"GNB\" #> [25] \"KEN\" \"LSO\" \"LBR\" \"MDG\" \"MWI\" \"MLI\" \"MRT\" \"MUS\" \"MOZ\" \"NAM\" \"NER\" \"NGA\" #> [37] \"RWA\" \"STP\" \"SEN\" \"SYC\" \"SLE\" \"SOM\" \"ZAF\" \"SSD\" \"SDN\" \"TGO\" \"UGA\" \"TZA\" #> [49] \"ZMB\" \"ZWE\""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/load_or_install_packages.html","id":null,"dir":"Reference","previous_headings":"","what":"Load or Install Required Packages (with GitHub handling for mobility, propvacc, and MOSAIC) — load_or_install_packages","title":"Load or Install Required Packages (with GitHub handling for mobility, propvacc, and MOSAIC) — load_or_install_packages","text":"function checks whether specified packages installed. package installed, installed. Special handling included mobility, propvacc, MOSAIC, installed GitHub.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/load_or_install_packages.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Load or Install Required Packages (with GitHub handling for mobility, propvacc, and MOSAIC) — load_or_install_packages","text":"","code":"load_or_install_packages(packages)"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/load_or_install_packages.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Load or Install Required Packages (with GitHub handling for mobility, propvacc, and MOSAIC) — load_or_install_packages","text":"packages character vector package names load install.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/load_or_install_packages.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Load or Install Required Packages (with GitHub handling for mobility, propvacc, and MOSAIC) — load_or_install_packages","text":"packages, function installs CRAN already installed. Special cases handled following packages: mobility: Installed GitHub https://github.com/COVID-19-Mobility-Data-Network/mobility. propvacc: Installed GitHub https://github.com/gilesjohnr/propvacc. MOSAIC: Installed GitHub https://github.com/InstituteforDiseaseModeling/MOSAIC-pkg.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/load_or_install_packages.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Load or Install Required Packages (with GitHub handling for mobility, propvacc, and MOSAIC) — load_or_install_packages","text":"","code":"if (FALSE) { load_or_install_packages(c(\"ggplot2\", \"mobility\", \"propvacc\", \"MOSAIC\")) }"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/make_param_df.html","id":null,"dir":"Reference","previous_headings":"","what":"Get Template for Parameter Values — make_param_df","title":"Get Template for Parameter Values — make_param_df","text":"function generates template long-form data frame parameter values, including origin (), destination (j), time (t), used simulate variables sigma.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/make_param_df.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get Template for Parameter Values — make_param_df","text":"","code":"make_param_df( variable_name = NULL, variable_description = NULL, parameter_distribution = NULL, i = NULL, j = NULL, t = NULL, parameter_name = NULL, parameter_value = NULL )"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/make_param_df.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get Template for Parameter Values — make_param_df","text":"variable_name character string representing name variable (e.g., 'sigma'). variable_description character string describing variable (e.g., 'proportion symptomatic'). parameter_distribution character string representing distribution parameter (e.g., 'beta'). vector representing origin locations. j vector representing destination locations. t vector representing time points. parameter_name character vector parameter names (e.g., shape1, shape2 beta distribution). parameter_value numeric vector parameter values (corresponding parameter names).","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/make_param_df.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get Template for Parameter Values — make_param_df","text":"data frame containing long-form template parameter values. arguments NULL, empty data frame returned.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/make_param_df.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get Template for Parameter Values — make_param_df","text":"","code":"# Example usage for sigma prm <- list(shape1 = 2, shape2 = 5) param_df <- make_param_df(\"sigma\", \"proportion symptomatic\", \"beta\", i = \"A\", j = \"B\", t = 1, names(prm), unlist(prm)) print(param_df) #> variable_name variable_description parameter_distribution i j t #> 1 sigma proportion symptomatic beta A B 1 #> 2 sigma proportion symptomatic beta A B 1 #> parameter_name parameter_value #> 1 shape1 2 #> 2 shape2 5"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/plot_CFR_by_country.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot Case Fatality Ratios, Total Cases, and Beta Distributions by Country — plot_CFR_by_country","title":"Plot Case Fatality Ratios, Total Cases, and Beta Distributions by Country — plot_CFR_by_country","text":"function creates two separate plots: one case fatality ratios (CFR) confidence intervals total cases country, another Beta distributions selected countries. plots generated based cholera data stored PATHS$DATA_WHO_ANNUAL directory.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/plot_CFR_by_country.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot Case Fatality Ratios, Total Cases, and Beta Distributions by Country — plot_CFR_by_country","text":"","code":"plot_CFR_by_country(PATHS)"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/plot_CFR_by_country.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot Case Fatality Ratios, Total Cases, and Beta Distributions by Country — plot_CFR_by_country","text":"PATHS list containing paths cholera data figures saved. Typically generated get_paths() function include: DATA_WHO_ANNUAL: Path directory processed annual cholera data located. DOCS_FIGURES: Path directory plots saved.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/plot_CFR_by_country.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot Case Fatality Ratios, Total Cases, and Beta Distributions by Country — plot_CFR_by_country","text":"list containing two ggplot objects: one CFR total cases, one Beta distributions.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/plot_CFR_by_country.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot Case Fatality Ratios, Total Cases, and Beta Distributions by Country — plot_CFR_by_country","text":"","code":"if (FALSE) { PATHS <- get_paths() plot_CFR_by_country(PATHS) }"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/plot_ENSO_data.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot ENSO and DMI Data — plot_ENSO_data","title":"Plot ENSO and DMI Data — plot_ENSO_data","text":"function creates facet plot visualize ENSO DMI data time, separate panels variable (DMI, ENSO3, ENSO34, ENSO4). horizontal line zero included indicate neutral value, vertical line marks current date, date displayed vertically left side line.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/plot_ENSO_data.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot ENSO and DMI Data — plot_ENSO_data","text":"","code":"plot_ENSO_data(compiled_data)"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/plot_ENSO_data.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot ENSO and DMI Data — plot_ENSO_data","text":"compiled_data data frame containing ENSO DMI data, columns date, variable, value. data typically generated compile_ENSO_data function.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/plot_ENSO_data.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot ENSO and DMI Data — plot_ENSO_data","text":"ggplot facet plot showing time series DMI, ENSO3, ENSO34, ENSO4 time. plot includes: horizontal solid line zero indicate neutral sea surface temperature anomaly. vertical dashed line indicate current date, current date displayed vertical text. Facets variable, allowing easy comparison DMI ENSO regions.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/plot_ENSO_data.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Plot ENSO and DMI Data — plot_ENSO_data","text":"function uses ggplot2 create line plot facets variable (DMI, ENSO3, ENSO34, ENSO4). adds horizontal reference line zero vertical line representing current date. current date displayed vertical text aligned left vertical line. data expected date, variable, value format.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/plot_ENSO_data.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot ENSO and DMI Data — plot_ENSO_data","text":"","code":"if (FALSE) { # Compile the ENSO and DMI data from the year 2000 onwards compiled_enso_data <- compile_ENSO_data(2010, \"daily\") # Plot the data plot_ENSO_data(compiled_enso_data) }"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/plot_africa_map.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot Africa Map with Cholera Outbreak Countries — plot_africa_map","title":"Plot Africa Map with Cholera Outbreak Countries — plot_africa_map","text":"function creates map Africa highlighting countries Sub-Saharan Africa cholera outbreaks past 5 10 years. map saved PNG file specified PATHS$DOCS_FIGURES directory.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/plot_africa_map.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot Africa Map with Cholera Outbreak Countries — plot_africa_map","text":"","code":"plot_africa_map(PATHS)"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/plot_africa_map.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot Africa Map with Cholera Outbreak Countries — plot_africa_map","text":"PATHS list containing paths figure saved. Typically generated get_paths() function include: DOCS_FIGURES: Path directory map image saved.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/plot_africa_map.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot Africa Map with Cholera Outbreak Countries — plot_africa_map","text":"ggplot object showing map.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/plot_africa_map.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Plot Africa Map with Cholera Outbreak Countries — plot_africa_map","text":"function generates map Africa, highlighting Sub-Saharan African countries cholera outbreaks past 5 10 years. map saved PNG file.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/plot_africa_map.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot Africa Map with Cholera Outbreak Countries — plot_africa_map","text":"","code":"if (FALSE) { # Assuming PATHS is generated from get_paths() PATHS <- get_paths() plot_africa_map(PATHS) }"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/plot_generation_time.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot Generation Time as Gamma Distribution for Days and Weeks — plot_generation_time","title":"Plot Generation Time as Gamma Distribution for Days and Weeks — plot_generation_time","text":"function generates combined plot generation time probability distribution days (based gamma distribution) aggregated weeks. resulting plot saved PNG file.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/plot_generation_time.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot Generation Time as Gamma Distribution for Days and Weeks — plot_generation_time","text":"","code":"plot_generation_time(PATHS)"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/plot_generation_time.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot Generation Time as Gamma Distribution for Days and Weeks — plot_generation_time","text":"PATHS list containing paths plot saved. Typically generated get_paths() function include: DOCS_FIGURES: Path directory generation time plot saved.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/plot_mobility.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot Mobility Data, Mobility Network, and Results — plot_mobility","title":"Plot Mobility Data, Mobility Network, and Results — plot_mobility","text":"function loads visualizes mobility data, including flight data, travel probabilities, diffusion model estimates, mobility network.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/plot_mobility.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot Mobility Data, Mobility Network, and Results — plot_mobility","text":"","code":"plot_mobility(PATHS)"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/plot_mobility.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot Mobility Data, Mobility Network, and Results — plot_mobility","text":"PATHS list containing paths data, models, figures stored. Typically generated get_paths() function include: MODEL_INPUT: Path directory mobility matrices parameter estimates saved. DATA_SHAPEFILES: Path directory containing shapefiles African countries. DOCS_FIGURES: Path directory figures saved.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/plot_mobility.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot Mobility Data, Mobility Network, and Results — plot_mobility","text":"function generates saves mobility-related visualizations PNG files.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/plot_shedding_rate.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot Shedding Rate as a Function of Environmental Suitability — plot_shedding_rate","title":"Plot Shedding Rate as a Function of Environmental Suitability — plot_shedding_rate","text":"function generates plot visualizes suitability-dependent decay rate environmental shedding based climate-driven environmental suitability (\\(\\psi_{jt}\\)). function generates three models decay rate \\(\\delta_{jt}\\): \\(\\delta_{jt} = 1 - \\psi_{jt}\\): simple linear transformation \\(\\psi_{jt}\\). \\(\\delta_{jt} = 1 - \\frac{1}{1 + (1 - \\psi_{jt})}\\): nonlinear transformation \\(\\psi_{jt}\\). \\(\\delta_{jt} = \\delta_{\\min} + \\psi_{jt} \\cdot (\\delta_{\\max} - \\delta_{\\min})\\): linear transformation based minimum maximum decay rates. plot saved PNG file directory specified PATHS$DOCS_FIGURES.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/plot_shedding_rate.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot Shedding Rate as a Function of Environmental Suitability — plot_shedding_rate","text":"","code":"plot_shedding_rate(PATHS)"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/plot_shedding_rate.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot Shedding Rate as a Function of Environmental Suitability — plot_shedding_rate","text":"PATHS list containing paths plot saved. Typically generated get_paths() function include: DOCS_FIGURES: Path directory plot saved.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/plot_shedding_rate.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot Shedding Rate as a Function of Environmental Suitability — plot_shedding_rate","text":"","code":"if (FALSE) { # Assuming PATHS is generated from get_paths() PATHS <- get_paths() plot_shedding_rate(PATHS) }"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/plot_suspected_cases.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot Proportion of Suspected Cholera Cases — plot_suspected_cases","title":"Plot Proportion of Suspected Cholera Cases — plot_suspected_cases","text":"function loads parameter data frame proportion suspected cholera cases (rho) param_rho_suspected_cases.csv file generates plot showing probability distributions low high estimates, custom annotations formatting.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/plot_suspected_cases.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot Proportion of Suspected Cholera Cases — plot_suspected_cases","text":"","code":"plot_suspected_cases(PATHS)"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/plot_suspected_cases.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot Proportion of Suspected Cholera Cases — plot_suspected_cases","text":"PATHS list containing paths parameter data figures saved. Typically generated get_paths() function include: MODEL_INPUT: Path directory parameter data frame stored. DOCS_FIGURES: Path directory plot saved.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/plot_vaccine_effectiveness.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot Vaccine Effectiveness and Beta Distribution — plot_vaccine_effectiveness","title":"Plot Vaccine Effectiveness and Beta Distribution — plot_vaccine_effectiveness","text":"function generates two plots: one showing vaccine effectiveness decay time, another showing Beta distribution initial vaccine effectiveness.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/plot_vaccine_effectiveness.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot Vaccine Effectiveness and Beta Distribution — plot_vaccine_effectiveness","text":"","code":"plot_vaccine_effectiveness(PATHS)"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/plot_vaccine_effectiveness.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot Vaccine Effectiveness and Beta Distribution — plot_vaccine_effectiveness","text":"PATHS list containing paths figures saved. Typically generated get_paths() function include: DOCS_FIGURES: Path directory figures saved.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/process_CFR_data.html","id":null,"dir":"Reference","previous_headings":"","what":"Process Cholera Data to Calculate Aggregated Case Fatality Ratios and Fit Beta Distributions (2014-2024) — process_CFR_data","title":"Process Cholera Data to Calculate Aggregated Case Fatality Ratios and Fit Beta Distributions (2014-2024) — process_CFR_data","text":"function processes cholera data, aggregates cases deaths country period 2014-2024, calculates aggregated Case Fatality Ratio (CFR), fits Beta distributions country. Countries fewer cases min_obs CFR set value AFRO Region.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/process_CFR_data.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Process Cholera Data to Calculate Aggregated Case Fatality Ratios and Fit Beta Distributions (2014-2024) — process_CFR_data","text":"","code":"process_CFR_data(PATHS, min_obs)"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/process_CFR_data.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Process Cholera Data to Calculate Aggregated Case Fatality Ratios and Fit Beta Distributions (2014-2024) — process_CFR_data","text":"PATHS list containing paths cholera data located. Typically generated get_paths() function include: DATA_WHO_ANNUAL: Path directory containing processed annual cholera data. DOCS_TABLES: Path directory processed CFR data saved. min_obs integer specifying minimum number cases required country CFR. Countries fewer cases threshold CFR set value AFRO Region.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/process_CFR_data.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Process Cholera Data to Calculate Aggregated Case Fatality Ratios and Fit Beta Distributions (2014-2024) — process_CFR_data","text":"data frame aggregated CFR, confidence intervals, Beta distribution parameters country.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/process_CFR_data.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Process Cholera Data to Calculate Aggregated Case Fatality Ratios and Fit Beta Distributions (2014-2024) — process_CFR_data","text":"","code":"if (FALSE) { PATHS <- get_paths() cholera_data <- process_CFR_data(PATHS, min_obs = 100) }"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/process_OAG_data.html","id":null,"dir":"Reference","previous_headings":"","what":"Process and Save OAG Flight Data for Africa — process_OAG_data","title":"Process and Save OAG Flight Data for Africa — process_OAG_data","text":"function processes raw OAG flight data African countries, including data cleaning, location date conversion, aggregation. processed data saved CSV files African countries subset countries used MOSAIC modeling framework.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/process_OAG_data.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Process and Save OAG Flight Data for Africa — process_OAG_data","text":"","code":"process_OAG_data(PATHS)"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/process_OAG_data.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Process and Save OAG Flight Data for Africa — process_OAG_data","text":"PATHS list containing paths raw processed data stored. PATHS typically output get_paths() function include following components: DATA_RAW: Path directory containing raw data files. DATA_PROCESSED: Path directory processed data saved. DATA_SHAPEFILES: Path directory containing shapefiles African countries.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/process_OAG_data.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Process and Save OAG Flight Data for Africa — process_OAG_data","text":"function processes OAG flight data saves aggregated results specified processed data paths.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/process_OAG_data.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Process and Save OAG Flight Data for Africa — process_OAG_data","text":"","code":"if (FALSE) { # Define paths for raw and processed data using get_paths() PATHS <- get_paths() # Process the OAG data and save the results process_OAG_data(PATHS) }"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/process_WHO_annual_data.html","id":null,"dir":"Reference","previous_headings":"","what":"Download, Process, and Save Historical Annual WHO Cholera Data for Africa — process_WHO_annual_data","title":"Download, Process, and Save Historical Annual WHO Cholera Data for Africa — process_WHO_annual_data","text":"function compiles historical cholera data African countries (AFRO region) years 1949 2024. data processed saved MOSAIC directory structure. includes reported cholera cases, deaths, case fatality ratios (CFR).","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/process_WHO_annual_data.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Download, Process, and Save Historical Annual WHO Cholera Data for Africa — process_WHO_annual_data","text":"","code":"process_WHO_annual_data(PATHS)"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/process_WHO_annual_data.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Download, Process, and Save Historical Annual WHO Cholera Data for Africa — process_WHO_annual_data","text":"PATHS list containing paths raw processed data directories. Typically generated get_paths() include: DATA_RAW: Path directory containing raw cholera data. DATA_WHO_ANNUAL: Path directory processed cholera data saved.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/process_WHO_annual_data.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Download, Process, and Save Historical Annual WHO Cholera Data for Africa — process_WHO_annual_data","text":"function return value processes saves historical cholera data CSV files processed data directory.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/process_WHO_annual_data.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Download, Process, and Save Historical Annual WHO Cholera Data for Africa — process_WHO_annual_data","text":"function compiles cholera data African countries (AFRO region) processing historical data 1949-2024. data sources follows: 1949-2021: Data compiled annual reports World Data. See https://ourworldindata.org. 2022: Data manually extracted annual report. 2023-2024: Data downloaded directly AWD GIS dashboard. Additionally, function calculates 95% binomial confidence intervals CFR applicable, data saved CSV files processed data directory.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/process_WHO_annual_data.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Download, Process, and Save Historical Annual WHO Cholera Data for Africa — process_WHO_annual_data","text":"","code":"if (FALSE) { # Assuming PATHS is generated from get_paths() PATHS <- get_paths() # Download and process WHO annual cholera data process_WHO_annual_data(PATHS) }"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/process_WHO_weekly_data.html","id":null,"dir":"Reference","previous_headings":"","what":"Process Weekly Cholera Data: Convert Country Names to ISO3 and Filter by AFRO Countries — process_WHO_weekly_data","title":"Process Weekly Cholera Data: Convert Country Names to ISO3 and Filter by AFRO Countries — process_WHO_weekly_data","text":"function processes cholera data converting country names ISO3 codes, filtering AFRO region countries, cleaning organizing data analysis.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/process_WHO_weekly_data.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Process Weekly Cholera Data: Convert Country Names to ISO3 and Filter by AFRO Countries — process_WHO_weekly_data","text":"","code":"process_WHO_weekly_data(PATHS)"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/process_WHO_weekly_data.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Process Weekly Cholera Data: Convert Country Names to ISO3 and Filter by AFRO Countries — process_WHO_weekly_data","text":"PATHS list containing paths raw processed data directories. Typically generated get_paths() function include: DATA_RAW: Path raw cholera data file (e.g., cholera_country_weekly.csv). DATA_PROCESSED: Path save processed cholera data (e.g., cholera_country_weekly_processed.csv).","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/process_WHO_weekly_data.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Process Weekly Cholera Data: Convert Country Names to ISO3 and Filter by AFRO Countries — process_WHO_weekly_data","text":"function return value processes cholera data saves specified file CSV.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/process_WHO_weekly_data.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Process Weekly Cholera Data: Convert Country Names to ISO3 and Filter by AFRO Countries — process_WHO_weekly_data","text":"function reads cholera data, converts country names ISO3 codes (vice versa), filters countries AFRO region, ensures data cleaned organized year week. also handles special cases renaming Democratic Republic Congo Congo (Republic) modifies column names consistency.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/process_WHO_weekly_data.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Process Weekly Cholera Data: Convert Country Names to ISO3 and Filter by AFRO Countries — process_WHO_weekly_data","text":"","code":"if (FALSE) { # Assuming PATHS is generated from get_paths() PATHS <- get_paths() # Process cholera data process_WHO_weekly_data(PATHS) }"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/process_demographics_data.html","id":null,"dir":"Reference","previous_headings":"","what":"Process UN World Prospects Data for African Countries — process_demographics_data","title":"Process UN World Prospects Data for African Countries — process_demographics_data","text":"function processes demographic data UN World Population Prospects African countries. filters data specified years, calculates population, birth rates, death rates per day, saves processed data CSV file.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/process_demographics_data.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Process UN World Prospects Data for African Countries — process_demographics_data","text":"","code":"process_demographics_data(PATHS)"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/process_demographics_data.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Process UN World Prospects Data for African Countries — process_demographics_data","text":"PATHS list containing paths raw processed data stored. PATHS typically output get_paths() function include following components: DATA_RAW: Path directory containing raw UN World Population Prospects data. DATA_PROCESSED: Path directory processed demographic data saved.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/process_demographics_data.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Process UN World Prospects Data for African Countries — process_demographics_data","text":"function return value. processes UN demographic data saves aggregated results CSV file specified directory.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/process_demographics_data.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Process UN World Prospects Data for African Countries — process_demographics_data","text":"function performs following steps: Loads raw demographic data CSV file. Filters data specified years African countries. Calculates population, birth rate, death rate per day country. Saves processed data CSV file processed data directory. processed data file saved PATHS$DATA_PROCESSED/demographics/ directory, filename includes year range data.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/process_demographics_data.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Process UN World Prospects Data for African Countries — process_demographics_data","text":"","code":"if (FALSE) { # Define paths for raw and processed data using get_paths() PATHS <- get_paths() # Process the UN World Prospects data and save the results process_demographics_data(PATHS) }"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/run_WHO_annual_data_app.html","id":null,"dir":"Reference","previous_headings":"","what":"Run Shiny Application for Visualizing WHO Annual Cholera Data in AFRO Countries — run_WHO_annual_data_app","title":"Run Shiny Application for Visualizing WHO Annual Cholera Data in AFRO Countries — run_WHO_annual_data_app","text":"function launches Shiny app visualizes cholera cases, deaths, case fatality rate (CFR) countries AFRO region 1970 2024. Users can select metric (cases, deaths, CFR) filter specific countries.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/run_WHO_annual_data_app.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Run Shiny Application for Visualizing WHO Annual Cholera Data in AFRO Countries — run_WHO_annual_data_app","text":"","code":"run_WHO_annual_data_app(PATHS)"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/run_WHO_annual_data_app.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Run Shiny Application for Visualizing WHO Annual Cholera Data in AFRO Countries — run_WHO_annual_data_app","text":"PATHS list containing paths processed cholera data file. Typically generated get_paths() function include: DATA_WHO_ANNUAL: Path directory containing processed cholera data file (e.g., who_afro_annual_1949_2024.csv).","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/run_WHO_annual_data_app.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Run Shiny Application for Visualizing WHO Annual Cholera Data in AFRO Countries — run_WHO_annual_data_app","text":"function creates Shiny app allows users explore cholera incidence data across AFRO countries 1970 2024. Users can choose viewing cases, deaths, CFR can select specific countries visualization. app generates bar plots cases deaths, point plots error bars CFR.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/run_WHO_annual_data_app.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Run Shiny Application for Visualizing WHO Annual Cholera Data in AFRO Countries — run_WHO_annual_data_app","text":"","code":"if (FALSE) { # Define paths for processed data PATHS <- get_paths() # Run the cholera Shiny app run_WHO_annual_data_app(PATHS) }"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/set_openmeteo_api_key.html","id":null,"dir":"Reference","previous_headings":"","what":"Set OpenMeteo API Key — set_openmeteo_api_key","title":"Set OpenMeteo API Key — set_openmeteo_api_key","text":"function sets OpenMeteo API key stores global option called openmeteo_api_key. API key provided argument, used. , function prompt key interactively.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/set_openmeteo_api_key.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Set OpenMeteo API Key — set_openmeteo_api_key","text":"","code":"set_openmeteo_api_key(api_key = NULL)"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/set_openmeteo_api_key.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Set OpenMeteo API Key — set_openmeteo_api_key","text":"api_key character string representing OpenMeteo API key. NULL, function prompt key interactively.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/set_openmeteo_api_key.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Set OpenMeteo API Key — set_openmeteo_api_key","text":"message confirming API key set, instructions retrieving key.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/set_openmeteo_api_key.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Set OpenMeteo API Key — set_openmeteo_api_key","text":"API key stored global option called openmeteo_api_key using options(). key can retrieved time using getOption(\"openmeteo_api_key\").","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/set_openmeteo_api_key.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Set OpenMeteo API Key — set_openmeteo_api_key","text":"","code":"# Set the OpenMeteo API key interactively set_openmeteo_api_key() #> Please enter your OpenMeteo API key: #> Error in set_openmeteo_api_key(): API key cannot be empty. Please provide a valid API key. # Set the OpenMeteo API key programmatically set_openmeteo_api_key(\"your-api-key-here\") #> OpenMeteo API key set successfully. #> Retrieve with getOption('openmeteo_api_key') # Access the API key getOption(\"openmeteo_api_key\") #> [1] \"your-api-key-here\""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/set_root_directory.html","id":null,"dir":"Reference","previous_headings":"","what":"Set Root Directory — set_root_directory","title":"Set Root Directory — set_root_directory","text":"function sets root directory user-specified path , provided, prompts user enter root directory interactively. directory path stored global option called root_directory also returned.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/set_root_directory.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Set Root Directory — set_root_directory","text":"","code":"set_root_directory(root = NULL)"},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/set_root_directory.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Set Root Directory — set_root_directory","text":"root character string representing path root directory. NULL, function prompt user enter root directory interactively.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/set_root_directory.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Set Root Directory — set_root_directory","text":"character string representing root directory. root directory also stored globally option root_directory.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/set_root_directory.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Set Root Directory — set_root_directory","text":"function uses either user-specified path path provided interactively set root directory. path validated ensure exists. validated, path stored global option root_directory, can accessed using getOption(\"root_directory\"). path invalid (.e., exist), function throws error.","code":""},{"path":"institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/set_root_directory.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Set Root Directory — set_root_directory","text":"","code":"if (FALSE) { # Set and display the root directory interactively root_dir <- set_root_directory() cat(\"Root directory:\", root_dir, \"\\n\") # Set the root directory programmatically root_dir <- set_root_directory(\"/path/to/root\") cat(\"Root directory:\", root_dir, \"\\n\") # Access the root directory from the global options getOption(\"root_directory\") }"}]
diff --git a/docs/sitemap.xml b/docs/sitemap.xml
index 3136c7d..0b89c23 100644
--- a/docs/sitemap.xml
+++ b/docs/sitemap.xml
@@ -72,6 +72,9 @@
institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/fit_mobility_model.html
+
+ institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/fourier_series_double.html
+ institutefordiseasemodeling.github.io/MOSAIC-pkg/reference/generate_country_grid_dist.html
diff --git a/man/download_climate_data.Rd b/man/download_climate_data.Rd
index 8175a2e..7cce894 100644
--- a/man/download_climate_data.Rd
+++ b/man/download_climate_data.Rd
@@ -2,7 +2,7 @@
% Please edit documentation in R/download_climate_data.R
\name{download_climate_data}
\alias{download_climate_data}
-\title{Download and Save Climate Data for Multiple Countries (Parquet Format, Single Model)}
+\title{Download and Save Climate Data for Multiple Countries (Parquet Format, Multiple Models and Variables)}
\usage{
download_climate_data(
PATHS,
@@ -10,7 +10,8 @@ download_climate_data(
n_points,
date_start,
date_stop,
- climate_model,
+ climate_models,
+ climate_variables,
api_key
)
}
@@ -30,7 +31,7 @@ PATHS is typically the output of the \code{get_paths()} function and should incl
\item{date_stop}{A character string representing the end date for the climate data (in "YYYY-MM-DD" format).}
-\item{climate_model}{A single character string representing the climate model to use. Available models include:
+\item{climate_models}{A character vector of climate models to use. Available models include:
\itemize{
\item \strong{CMCC_CM2_VHR4}
\item \strong{FGOALS_f3_H}
@@ -41,18 +42,32 @@ PATHS is typically the output of the \code{get_paths()} function and should incl
\item \strong{NICAM16_8S}
}}
+\item{climate_variables}{A character vector of climate variables to retrieve. See details for available variables.}
+
\item{api_key}{A character string representing the API key required to access the climate data API.}
}
\value{
-The function does not return a value. It downloads the climate data for each country and saves the results as Parquet files in the specified directory.
+The function does not return a value. It downloads the climate data for each country, climate model, and climate variable, saving the results as Parquet files in the specified directory.
}
\description{
-This function downloads daily climate data for a list of specified countries, saving the data as Parquet files. The data includes both historical and future climate variables at grid points within each country for a specified climate model.
+This function downloads daily climate data for a list of specified countries, saving the data as Parquet files. The data includes both historical and future climate variables at grid points within each country for a specified set of climate models and variables.
}
\details{
-This function uses country shapefiles to generate a grid of points within each country, at which climate data is downloaded. The function retrieves climate data for the specified date range (\code{date_start} to \code{date_stop}) and the specified climate model. The data is saved for each country in a Parquet file named \verb{climate_data_\{climate_model\}_\{date_start\}_\{date_stop\}_\{ISO3\}.parquet}.
+This function uses country shapefiles to generate a grid of points within each country, at which climate data is downloaded. The function retrieves climate data for the specified date range (\code{date_start} to \code{date_stop}) and the specified climate models and variables. The data is saved for each country, climate model, and climate variable in a Parquet file named \verb{climate_data_\{climate_model\}_\{climate_variable\}_\{date_start\}_\{date_stop\}_\{ISO3\}.parquet}.
-The climate data variables include temperature, wind speed, cloud cover, precipitation, and more. The function retrieves data from a single climate model.
+The available climate variables include:
+\itemize{
+\item \strong{temperature_2m_mean}, \strong{temperature_2m_max}, \strong{temperature_2m_min}
+\item \strong{wind_speed_10m_mean}, \strong{wind_speed_10m_max}
+\item \strong{cloud_cover_mean}
+\item \strong{shortwave_radiation_sum}
+\item \strong{relative_humidity_2m_mean}, \strong{relative_humidity_2m_max}, \strong{relative_humidity_2m_min}
+\item \strong{dew_point_2m_mean}, \strong{dew_point_2m_min}, \strong{dew_point_2m_max}
+\item \strong{precipitation_sum}, \strong{rain_sum}, \strong{snowfall_sum}
+\item \strong{pressure_msl_mean}
+\item \strong{soil_moisture_0_to_10cm_mean}
+\item \strong{et0_fao_evapotranspiration_sum}
+}
}
\examples{
\dontrun{
@@ -65,10 +80,11 @@ iso_codes <- c("ZAF", "KEN", "NGA")
# API key for climate data API
api_key <- "your-api-key-here"
-# Download climate data for a specified model and save it for the specified countries
+# Download climate data for multiple models and variables and save it for the specified countries
download_climate_data(PATHS, iso_codes, n_points = 5,
date_start = "1970-01-01", date_stop = "2030-12-31",
- climate_model = "MRI_AGCM3_2_S", api_key)
+ climate_models = c("MRI_AGCM3_2_S", "EC_Earth3P_HR"),
+ climate_variables = c("temperature_2m_mean", "precipitation_sum"), api_key)
}
}
diff --git a/man/est_seasonal_dynamics.Rd b/man/est_seasonal_dynamics.Rd
index 1b8240a..4b42eb7 100644
--- a/man/est_seasonal_dynamics.Rd
+++ b/man/est_seasonal_dynamics.Rd
@@ -2,17 +2,22 @@
% Please edit documentation in R/est_seasonal_dynamics.R
\name{est_seasonal_dynamics}
\alias{est_seasonal_dynamics}
-\title{Get Seasonal Dynamics Data for Cholera and Precipitation}
+\title{Estimate Seasonal Dynamics for Cholera and Precipitation Using Fourier Series}
\usage{
est_seasonal_dynamics(PATHS)
}
\arguments{
-\item{PATHS}{A list containing paths where raw and processed data are stored. Typically generated by the \code{get_paths()} function.}
+\item{PATHS}{A list containing paths where raw and processed data are stored. Typically generated by the \code{get_paths()} function and should include:
+\itemize{
+\item \strong{DATA_CLIMATE}: Path to the directory where climate data is stored.
+\item \strong{DATA_SHAPEFILES}: Path to the directory containing country shapefiles.
+\item \strong{DATA_WHO_WEEKLY}: Path to the directory containing cholera data.
+\item \strong{MODEL_INPUT}: Path to the directory where model input files will be saved.
+}}
}
\value{
-The function saves the parameter estimates, fitted values, and processed data as CSV files.
+The function saves the parameter estimates, fitted values, and processed data to a CSV file.
}
\description{
-This function retrieves historical precipitation data, processes cholera case data, fits seasonal dynamics models using Fourier series,
-and saves the results to a CSV file.
+This function retrieves historical precipitation data, processes cholera case data, and fits seasonal dynamics models using a double Fourier series. The results are saved to a CSV file, including parameter estimates, fitted values, and processed data.
}
diff --git a/man/fourier_series_double.Rd b/man/fourier_series_double.Rd
new file mode 100644
index 0000000..ca6d683
--- /dev/null
+++ b/man/fourier_series_double.Rd
@@ -0,0 +1,54 @@
+% Generated by roxygen2: do not edit by hand
+% Please edit documentation in R/fourier_series_double.R
+\name{fourier_series_double}
+\alias{fourier_series_double}
+\title{Fourier Series Model with Two Harmonics (Sine-Cosine Form)}
+\usage{
+fourier_series_double(t, beta0, a1, b1, a2, b2, p)
+}
+\arguments{
+\item{t}{A numeric vector representing time points (e.g., day of the year or week of the year).}
+
+\item{beta0}{A numeric value representing the intercept term (fixed at 0 by default).}
+
+\item{a1}{A numeric value representing the amplitude of the first cosine term (first harmonic).}
+
+\item{b1}{A numeric value representing the amplitude of the first sine term (first harmonic).}
+
+\item{a2}{A numeric value representing the amplitude of the second cosine term (second harmonic).}
+
+\item{b2}{A numeric value representing the amplitude of the second sine term (second harmonic).}
+
+\item{p}{A numeric value representing the period of the seasonal cycle (e.g., 52 for weekly data over a year).}
+}
+\value{
+A numeric vector of predicted values based on the Fourier series model.
+}
+\description{
+This function implements a generalized Fourier series model with two harmonics in the sine-cosine form. The model is often used to capture seasonal or periodic dynamics in time series data, such as temperature, precipitation, or disease cases.
+}
+\details{
+The model is defined as follows:
+\deqn{\beta_t = \beta_0 + a_1 \cos\left(\frac{2 \pi t}{p}\right) + b_1 \sin\left(\frac{2 \pi t}{p}\right) + a_2 \cos\left(\frac{4 \pi t}{p}\right) + b_2 \sin\left(\frac{4 \pi t}{p}\right)}
+The model includes an intercept term \code{beta0} (set to 0 by default) and two harmonics with coefficients \code{a1}, \code{b1}, \code{a2}, and \code{b2}. The period \code{p} controls the periodicity of the series.
+
+This function is based on the sine-cosine form of the Fourier series. For more details, see the Wikipedia page on \href{https://en.wikipedia.org/wiki/Fourier_series}{Fourier series}.
+
+This function is commonly used for modeling seasonal dynamics in environmental or epidemiological data, where periodic patterns are observed.
+}
+\examples{
+\dontrun{
+# Example usage with weekly data (p = 52 weeks in a year)
+time_points <- 1:52
+beta0 <- 0
+a1 <- 1.5
+b1 <- -0.5
+a2 <- 0.8
+b2 <- 0.3
+p <- 52
+
+predictions <- fourier_series_double(time_points, beta0, a1, b1, a2, b2, p)
+print(predictions)
+}
+
+}
diff --git a/pkgdown/_pkgdown.yml b/pkgdown/_pkgdown.yml
index 8bd200e..e75e838 100644
--- a/pkgdown/_pkgdown.yml
+++ b/pkgdown/_pkgdown.yml
@@ -70,6 +70,7 @@ reference:
- title: "Estimating model quantities"
contents:
- est_seasonal_dynamics
+ - fourier_series_double
- est_mobility
- est_WASH_coverage
- est_symptomatic_prop