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

wsup: An Implementation of the Water and Sanitation for the Urban Poor (WSUP) Urban Water and Sanitation Survey in R

Project Status: Active – The project has reached a stable, usable state and is being actively developed. Lifecycle: maturing CRAN CRAN CRAN Travis-CI Build Status AppVeyor build status codecov

Project on developing sampling and survey methods to assess water, sanitation and hygiene (WASH) indicators in urban areas. Project commissioned by Water and Sanitation for the Urban Poor (WSUP).

This package contains functions for producing WASH indicator results from datasets collected in the various WSUP focus cities i.e., Dhaka, Bangladesh; Accra, Ghana; Nakuru, Kenya; Antananarivo, Madagascar; Maputo, Mozambique; and, Lusaka, Zambia. These functions can be used by a competent useR in producing indicators results from datasets collected using the specific Urban Water and Sanitation Survey design.

This package also implements a Shiny application that provides a graphical user interface to performing the data processing, analysis and visualisation using the various functions contained in this package. This application can be used by anyone wanting to produce indicator results from datasets collected using the specific Urban Water and Sanitation Survey design without having to know how to use R.

This package supersedes the RAnalyticFlow-based implementation of the Urban Water and Sanitation Survey found in this repository.

Installation

This latest wsup version is in active development in preparation for submission to CRAN. You can install this development version of wsup from GitHub with:

if(!require(remotes)) install.packages("remotes")
remotes::install_github("validmeasures/wsup")

Usage

The wsup package includes four main families of functions: 1) recode functions; 2) data processing and handling functions; 3) data analysis functions; and 4) Shiny web application function.

Recode functions

All recode functions in wsup package start with the verb get_ then followed by the indicator set to be recoded. All recode functions take a survey dataset as its one and only argument. The survey dataset is expected to be collected using the specific Urban Water and Sanitation Survey survey questionnaire developed by WSUP. Survey dataset/s based on WSUP's survey questionnaire is available via the washdata package which is available via CRAN and is installed as a dependency when the wsup package is installed.

There are eight recode functions which recodes the following indicator sets:

  1. Administrative indicators

Administrative data is obtained as follows:

get_admin_vars(washdata::surveyDataBGD)
head(wsup::get_admin_vars(washdata::surveyDataBGD), 10)
  1. Demographic indicators

Demographic data is obtained as follows:

get_demo_vars(washdata::surveyDataBGD)
head(wsup::get_demo_vars(washdata::surveyDataBGD), 10)
  1. Handwashing indicators

Handwashing data is obtained and recoded as follows:

get_handwashing_vars(washdata::surveyDataBGD)
head(wsup::get_handwashing_vars(washdata::surveyDataBGD), 10)
  1. Hygiene indicators

Hygiene data is obtained and recoded as follows:

get_hygiene_vars(washdata::surveyDataBGD)
head(wsup::get_hygiene_vars(washdata::surveyDataBGD), 10)
  1. Sanitation indicators

Sanitation data is obtained and recoded as follows:

get_sanitation_vars(washdata::surveyDataBGD)
head(wsup::get_sanitation_vars(washdata::surveyDataBGD), 10)
  1. Water indicators

Water data is obtained and recoded as follows:

get_water_vars(washdata::surveyDataBGD)
head(wsup::get_water_vars(washdata::surveyDataBGD), 10)
  1. Poverty indicators

Poverty data is obtained and recoded as follows:

get_poverty_vars(washdata::surveyDataBGD,
                 ccode = "BGD",
                 ppiTable = ppitables::ppiBGD2013)
head(wsup::get_poverty_vars(washdata::surveyDataBGD, 
                            ccode = "BGD", 
                            ppiTable = ppitables::ppiBGD2013), 10)
  1. Overall summary indicators

Overall summary WASH data is obtained and recoded as follows:

get_overall_vars(adminDF = get_admin_vars(washdata::surveyDataBGD), 
                 waterDF = get_water_vars(washdata::surveyDataBGD), 
                 sanDF = get_sanitation_vars(washdata::surveyDataBGD))
head(wsup::get_overall_vars(adminDF = wsup::get_admin_vars(washdata::surveyDataBGD), 
                            waterDF = wsup::get_water_vars(washdata::surveyDataBGD), 
                            sanDF = wsup::get_sanitation_vars(washdata::surveyDataBGD)), 10)

Data processing and handling

This family of functions include 3 utilities for 1) combining all WASH indicators; 2) assigning datasets to North or South Dhaka Corporations; and, 3) getting variables names.

Data analysis

The wsup package includes 3 data analysis functions that 1) performs the LQAS classification on single data; 2) performs the LQAS classification on the full dataset; and, 3) estimates results of indicators at various stratification levels.

Shiny web app

A single function that runs the built-in Shiny web application in the wsup package.



validmeasures/wsup documentation built on Dec. 16, 2019, 4:50 a.m.