Skip to contents

Data Integration

sn_get_map_walk_healthcare() sn_get_map_motor_healthcare()
Importation of data from MAP
sn_get_dhs()
Import DHS data from API
sn_get_files()
Smart file reader
sn_get_who_gis_adm2_shp()
Generate ADM2 shapefiles from WHO GIS Hub
sn_read_star()
Read a list of raster data
import_replace()
A helper function to import routine database
import_routine_rename
Database for Rename column names in Routine Data
import_routine_replace
Database for Replace column values in Routine Data
import_routine_replace_hfname
Database for Replace health facilities in Routine Data
import_routine_set_cluster
Database for Set Adm2 Cluster in Routine Data
bind_who_gis_adm2_shp() extract_country_from_who_gis_adm2_shp() extract_adm1_adm2_from_who_gis_adm2_shp() extract_shp_from_gishub()
Generate ADM2 shapefiles from WHO GIS Hub
smart_read_excel_by_year()
Read excel files by year

Data Cleaning

sn_check_dups()
Check for duplicates in a data frame
sn_check_fuzzy()
Fuzzy match
sn_check_laps()
Check laps
sn_check_outliers()
Find outlier
sn_clean_dups()
Merge duplicates in a data frame
sn_clean_missing()
Remove and export missing data
sn_clean_outliers()
Data.table version of find_outliers
sn_clean_str_slice_to_end()
String Util Slice a pattern and append it to the end
sn_clean_str_trim_space()
Replace double space replace two or more spaces with one space
adm_rename()
rename the administrative zone names
routine_rename()
Rename Columns in Routine data
routine_replace()
Replace routine database

Data Transformation

sn_to_lower()
Renaming the dataset to lower case
sn_to_numeric()
Transmute numeric columns to the correct type
sn_gen_assemble()
Assemble data 🈴
sn_gen_dissect()
Dissect data
sn_gen_id()
Generate ID if not exist data.table version
gen_id_if_not_exist()
Generate ID if not exist
sum_maltreat_ov5_by_sex()
Sum maltreat over 5 years old by female and male
sum_maltreat_u5_by_sex()
Sum maltreat under 5 years old by female and male
scale_numbered()
Numbered axis
sn_extract_month_from_year_week()
Extract month from year and week
sn_keep_na_sum()
Sum but keep NA

Data Reduction

sn_st_aggregate() sn_st_crop()
stars aggregate function
sn_reduce_odd_or_even()
Get odd or even rows from a tibble
fuzzy_match_enhanced()
Fuzzy match result Identify and remove duplicate reports
sn_check_fuzzy()
Fuzzy match

Databases

dbq_select()
dbp select

Analysis

sn_ana_adj1()
Calculate the adjusted incidence 1
sn_ana_adj2()
Calculate the adjusted incidence 2
sn_ana_adj3()
Calculate the adjusted incidence 3
sn_ana_report_rate()
report rate
sn_ana_report_status()
Calculate the reporting rate
adjust_incidence_1()
Adjust incidence 1
adjust_incidence_2()
Adjust incidence 2
adjust_incidence_3()
Adjust incidence 3
sn_outbreak()
Outbreak detection
get_report_duration()
Calculate the report duration Get the min max report year and month for each group based on the report status This code filters the data by the reported column to only include data that is reported, then groups the data by the variables specified in the function call. It then calculates the min and max year and month for each group, and then filters out any groups that have NA for the min year.
expected()
Calculate the expected reports
get_by_cols()
Get group by columns
sn_aggregate_by()
Aggregate_by, a helper function for generating the aggregation information
report_rate()
Calculate the reporting rate for each indicator
report_status()
Calculate the report status
sn_antijoin()
Get the anti-join from two dbs
sn_intersect()
Get the intersect from two dbs
sn_unique_diff()
Get the unique values not in compare database

Development

dev_update()
Devtools: development update function all combined in one command
update_database()
Devtools : Update SNT databases
sn_format()
Opinioned formatting function
generate_default_gitignore()
Generate Default .gitignore
mkdir()
Make Directory
type_of_path()
Check type of path
use_relative_or_absolute()
Check to use relative or absolute path

Math

sn_math_mean()
Faster Mean

Plot

sn_theme()
theme default theme for plots
sn_plot_consistency()
Consistency check plot
sn_plot_incidence_by_year()
Plot incidences
sn_plot_outliers()
Plot outliers by year
sn_plot_rainfall()
Generate a rainfall plot
sn_plot_reprat_by_adm()
Plot report rate by adm1
sn_plot_reprat_by_index()
Plot report rate by index
sn_color_false
color False
sn_color_true
color True
align_plots()
align plots Align plots in a grid, with the same width and height in the plot area. Use methods from the cowplot package.
plot_adm1_report_rate()
Plot Report Status by district month
plot_hf_report_status()
Plot Report Status
plot_indicator_report_rate()
Plot Report Status by indicators
plot_map_by_year()
Plot incidences
plot_outliers()
Plot outliers
color
color palette
complementary_color()
compute complementary color

Config

config_set_db() config_get_db() config_parallel() config_get_country()
Config database
generate_default_config()
Generate Default Config
get_os()
Get OS
get_path()
Get path
setup()
Make Structure