knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)

WSC

R-CMD-check

About this package

This package offers functions to process data according to the WSC guidelines.

Functions rely on the existence of two global analysis plans:

To contextualise the analysis to the environment in which the WSC is applied, users should create:

The data is stored on googlesheets to ease the remote use of the package, but the functions use data.frames as inputs.

Installation

You can install the latest version of WSC from github with:

devtools::install_github("ElliottMess/WSC")

Main Functions

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.

1. score_WIS

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))

2. agg_score

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))

3. twenty_rule

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))

4. assign_hiAdmin_loAdmin

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))

5. score_df_AP

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))

About the WSC

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.



ElliottMess/WSC documentation built on Jan. 8, 2021, 12:42 a.m.