knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" )
This package offers functions to process data according to the WSC guidelines.
Functions rely on the existence of two global analysis plans:
WSC::WSC_AP
)WSC::WIS_water
, WSC::WIS_sanitation
, WSC::WIS_final
)To contextualise the analysis to the environment in which the WSC is applied, users should create:
WSC::context_AP
.The data is stored on googlesheets to ease the remote use of the package, but the functions use data.frames
as inputs.
You can install the latest version of WSC from github with:
devtools::install_github("ElliottMess/WSC")
The package contains three main functions:
1. WSC::score_WIS(): scores a dataset according to the calculation model. 2. WSC::agg_score(): aggregates results at a specified administrative level 3. WSC::twenty_rule(): applies the 20% rule to a specified datasets 4. WSC::assign_hiAdmin_loAdmin(): assign results from a higher administrative level to a lower one in an uniform way (all lower units part of a higher administrative unit have the same value). 5. WSC::score_df_AP(): Score dataset according to the Analysis Plan (AP) phases. 6. WSC::scoring_var(): Score individual variables according to AP.
Working examples are provided for all the functions based on the datasets documented within the package.
library(WSC) library(knitr) WIS_scored <- score_WIS(data = WSC::bfa_msna_2020, context_AP = WSC::context_AP, context = "bfa_2020", WSC_AP = WSC::WSC_AP, WIS_water = WSC::WIS_water, WIS_sanitation = WSC::WIS_sanitation, WIS_final = WSC::WIS_final) kable(head(WIS_scored))
library(WSC) library(knitr) score_agg_admin2 <- agg_score(context = "bfa_2020", context_AP = WSC::context_AP, WSC_AP = WSC::WSC_AP, data = WSC::bfa_msna_2020) kable(head(score_agg_admin2))
library(WSC) library(knitr) admin2_twenty_ruled <- twenty_rule(data = score_agg_admin2, col_score = "indicator", col_label = "choice", name_final_score = "score_final", col_agg = "admin2", col_value = "value") kable(head(admin2_twenty_ruled))
library(WSC) library(knitr) admin1_admin2_agg <- assign_hiAdmin_loAdmin(HiAdmin_df = WSC::bfa_smart_2019_admin1, HiAdmin_name = "admin1", HiAdmin_df_name = "smart_2019_admin1", context = "bfa_2020", context_AP = WSC::context_AP, WSC_AP = WSC::WSC_AP, LoAdmin_df = WSC::bfa_msna_2020, LoAdmin_name = "admin2") kable(head(admin1_admin2_agg))
library(WSC) library(knitr) area_df <- score_df_AP(data = WSC::bfa_smart_2019_admin1, data_name = "smart_2019_admin1", data_type = "area", agg_level = "admin1", context = "bfa_2020", context_AP = WSC::context_AP, WSC_AP = WSC::WSC_AP) hh_df <- score_df_AP(data = WSC::bfa_msna_2020, data_name = "msna_2020", data_type = "hh", agg_level = "admin1", context = "bfa_2020", context_AP = WSC::context_AP, WSC_AP = WSC::WSC_AP) kable(head(hh_df))
The WASH Severity Classification (WSC) is a new interagency global initiative led by the Global WASH Cluster, UNICEF, and IMPACT Initiatives. Developed at the global level through a participatory process, the WSC project aims to develop a standardized approach to classifying the severity of WASH needs and vulnerabilities across contexts. For more information, contact wsc@reach-initiative.org.
As the documentation relating to the WSC is still under development, direct links to them are replaced by placeholder_link.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.