Skip to contents

Data import and export

Read and write a wide range of tabular and spatial formats, with an SNT-aware wrapper that hashes, fingerprints and writes sidecar metadata.

read()
Read in Data and Shapefiles from Various File Formats
write()
Save Data and Shapefiles to Various File Formats
read_snt_data()
Read the most-recently modified saved dataset
write_snt_data()
Write an object to standardized filenames in one or more formats

Data cleaning and standardisation

Type inference, date parsing, name and column harmonisation, and dictionary building.

auto_parse_types()
Infer column types using readr, then layer factor detection
autoparse_dates()
Parse Dates in a Data Frame
available_date_formats
Available date formats for autoparse_dates function
standardize_names()
Standardize name-like strings with optional steps
clean_filenames()
Clean Filenames
prep_geonames()
Interactive Admin Name Cleaning and Matching
build_dictionary()
build a compact data dictionary
snt_data_dict()
Load and flatten the SNT variable tree
check_snt_var()
Detect and display the structural components of an SNT variable name

Spatial validation and mapping

Validate and harmonise admin geometries and facility coordinates, crosswalk between shapefile vintages, fuzzy-match names, and render maps.

validate_process_spatial()
Spatial Vector Validation and Cleaning
validate_process_coordinates()
Coordinate Validation and Cleaning
fuzzy_match_facilities()
Facility name matching across datasets (DHIS2 vs MFL)
calculate_match_stats()
Calculate and report geo-naming match statistics
crosswalk_shapefiles_sf()
Create an area-weighted crosswalk between old and new admin polygons
dhis2_map()
Crosswalk DHIS2 dataset using dictionary
plot_admin_map_distinct()
Color admin groups so touching neighbors never share a color
facetted_map_bins()
Plot Faceted Choropleth Maps from sf Data with Discrete Bins
facetted_map_gradient()
Plot Faceted Choropleth Maps from sf Data with Continuous Gradient
get_palette()
Get a color palette
list_palettes()
List available palette names
download_shapefile()
Download WHO Administrative Boundaries with Partial Update

Routine surveillance - reporting rates

Quantify and visualise how completely health facilities are reporting, by time and admin unit.

calculate_reporting_metrics()
Calculate reporting/missing rate and proportion of reporting facilities
calculate_reporting_metrics_dates()
Calculate reporting metrics based on facility date ranges
reporting_rate_plot()
Plot Missing data or Reporting Rate over time
reporting_rate_map()
Plot reporting rate maps over time
facility_reporting_plot()
Plot monthly reporting activity by health facility
classify_facility_activity()
Classify health facility activity status by reporting behaviour
get_active_facilities()
Get active facilities from a dataset
validate_routine_hf_data()
Orchestrates a suite of validation checks on routine HF data. It standardizes column resolution, selects indicators, runs missing/duplicate/future/logic/ outlier checks, compiles a summary, and optionally translates and saves.

Routine surveillance - data quality

Cascade consistency checks, outlier detection and correction, imputation helpers.

consistency_check()
Consistency Check Function
consistency_map()
Consistency violation map
detect_outliers()
Detect outliers with guardrails and consensus
outlier_plot()
Create Outlier Detection Plots
correct_outliers()
Correct outliers using temporal neighbors
impute_outlier_ma()
Impute outliers using moving average from adjacent time points
impute_higher_admin()
Impute higher administrative level using a lookup table
compare_methods_plot()
Compare facility activity classification methods (multilingual)
fallback_diff()
Fallback Absolute Difference Between Two Vectors (type-preserving)
fallback_row_sum()
Smart row-wise sum with missing data handling and type preservation
safe_sum()
Row-safe sum for grouped aggregation

Climate and environmental downloads

Pull rainfall, temperature, land cover and other environmental rasters from public archives.

download_chirps()
Download CHIRPS Raster Data from UCSB Archive
check_chirps_available()
List Available CHIRPS Raster Files for a Dataset
chirps_options()
List Available Monthly CHIRPS Dataset Options
download_era5()
Download ERA5 Data from Copernicus CDS
check_era5_available()
List Available ERA5 Files for a Dataset
era5_options()
List Available ERA5 Dataset Options
get_era5_metadata()
Get Metadata from ERA5 NetCDF File
print_era5_metadata()
Print ERA5 Metadata Summary
read_era5()
Read and Process ERA5 NetCDF Files to Tidy Data
migrate_era5_filenames()
Migrate ERA5 Filenames to New Format
download_modis()
Download MODIS Data from NASA
modis_options()
List Available MODIS Products
download_process_nasapower()
Download and process NASA POWER daily climate data
process_ihme_u5m_raster()
Extract Under-5 Mortality Values from IHME Raster Stack

Population downloads and processing

WorldPop downloads (totals, age-bands, urbanicity), extrapolation, and SNT-shaped population outputs.

download_worldpop()
Download Population Rasters from WorldPop
download_worldpop_age_band()
Download WorldPop Population Raster Data for Specific Age Bands
download_worldpop_urbanicity()
Download WorldPop DUG Urbanicity Rasters
get_worldpop_paths()
Download WorldPop Rasters and Get Paths
extrapolate_pop()
Extrapolate Population Estimates for Target Years
snt_process_population()
Summarise population by available admin levels and build a dictionary

Raster batch processing

Aggregate raster stacks to admin units (zonal stats), with optional population weighting and time-varying boundaries.

process_raster_collection()
Process multiple raster files from a directory
process_raster_with_boundaries()
Process raster data with administrative boundaries
process_rasters_by_year()
Process Year-Indexed Rasters Against Time-Varying Admin Boundaries
process_weighted_raster_collection()
Process Weighted Raster Data in Batch
process_weighted_raster_stacks()
Process Weighted Raster Stacks
normalize_raster_by_polygon()
Normalize Raster Values by Polygon Regions
tidy_malaria_raster_names()
Normalize malariaAtlas Raster Filenames

DHS indicators

Bulk download and lookup of DHS/MIS indicators.

download_dhs_indicators()
Query DHS API Directly via URL Parameters
check_dhs_indicators()
Check DHS Indicator List from API
get_dhs_data()
Load DHS Parquet datasets using DuckDB

EMOD demography and weather inputs

Build demographic and climate inputs for EMOD-style simulations from SNT data.

build_emod_demog()
Build EMOD Demographics JSON for a Single Node
build_emod_demog_from_wpp()
Build EMOD Demographic Inputs from UN WPP 2024 Data
write_emod_demog_by_adm2()
Write EMOD Demographics JSON Files by ADM2
read_emod_weather()
Read EMOD weather binary files into a data.frame
write_emod_weather()
Write EMOD binary weather files (.bin + .json) from a data.frame
write_emod_weather_by_adm2()
Write EMOD weather files per adm2 (one folder per district)

Project structure and paths

Create the AHADI hierarchical data folders, set up a full project skeleton, resolve standardised paths.

setup_project_paths()
Setup project paths and environment for SNT pipeline
create_data_structure()
Create Hierarchical Data Folder Structure (AHADI Style)
initialize_project_structure()
Initialize Full Project Folder Structure
ahadi_path()
Resolve path inside AHADI OneDrive shared library
clear_snt_cache()
clear snt variable tree cache

Translation and localisation

Cached Google Translate wrappers plus locale-aware year-month formatting.

translate_text()
Translate text to target language with persistent file cache
translate_text_vec()
Vectorized version of translate_text function
translate_yearmon()
Convert date to yearmon format with localized month names
french_malaria_acronyms()
French malaria acronyms mapping

Plotting helpers and trend models

Reusable building blocks for SNT plots - palettes, model wrappers, IR plots.

get_model()
Fit regression model for insecticide resistance trends
generate_ir_plot()
Generate insecticide resistance trend plot
run_resistance_trend()
Generate insecticide resistance trend scenarios
prepare_plot_data()
Prepare data for reporting rate or missing data visualization
get_pathway_vars()
Get Upstream and Downstream Variables for Malaria Pathway Indicators
auto_bin()
Automatically bin numeric data for choropleth maps
detect_factors()
Detect factor-like character columns (low-cardinality only)
detect_time_pattern()
Detect time pattern in filenames
extract_time_components()
Extract time components from a filename

Numeric and hashing utilities

Small but very-used helpers that show up across SNT pipelines.

big_mark()
Format Numbers with Thousand Separator
sum2()
Sum values with automatic NA handling
mean2()
Calculate mean with automatic NA handling
median2()
Calculate median with automatic NA handling
vdigest()
Vectorized version of digest::digest
compress_png()
Compress PNG Files in a Directory or a Single PNG File with pngquant