R/wsup.R

################################################################################
#
#' An Implementation of the WSUP Urban Water and Sanitation Survey in R
#'
#' @docType package
#' @name wsup
#' @keywords internal
#' @importFrom bbw bootBW bootClassic bootPROBIT
#' @importFrom tidyr gather
#' @importFrom stringr str_split
#' @importFrom stats quantile aggregate
#' @importFrom sp spTransform
#' @importFrom shiny runApp
#'
#
################################################################################
"_PACKAGE"

## quiets concerns of R CMD check re: the psus and THRESHOLD that appear in bbw
if(getRversion() >= "2.15.1") {  
  utils::globalVariables(c("corprtn", "surveyData", "indicator.code", "other.cases",
                           "other.class", "other.total", "slum.cases", "slum.class",
                           "slum.total", "steerIndicators"))
}

################################################################################
#
#' A dataset of class SpatialPolygonsDataFrame that contains the coordinates of
#' the polygon of level 0 administrative unit of Accra, Ghana
#' 
#' @format A dataset of class SpatialPolygonsDataFrame with 1 feature with 14
#'     fields
#' \describe{
#' \item{\code{ID_0}}{Administrative unit level 0 identifying code (i.e., code for Ghana)}
#' \item{\code{ISO}}{International Organization for Standardization (ISO) code}
#' \item{\code{NAME_0}}{Name of administrative unit level 0 (i.e., Ghana)}
#' \item{\code{ID_1}}{Administrative unit level 1 identifying code (i.e., code for Accra)}
#' \item{\code{NAME_1}}{Name of administrative unit level 1 (i.e., Accra)}
#' \item{\code{ID_2}}{Administrative unit level 2 identifying code}
#' \item{\code{NAME_2}}{Name of administrative unit level 2}
#' \item{\code{HASC_2}}{}
#' \item{\code{CCN_2}}{}
#' \item{\code{CCA_2}}{}
#' \item{\code{TYPE_2}}{Type of administrative unit level 2}
#' \item{\code{ENGTYPE_2}}{Type of administrative unit level 2 (English)}
#' \item{\code{NL_NAME_2}}{Name of administrative unit level 2 (National language)}
#' \item{\code{VARNAME_2}}{Name of administrative unit level 2 (variation)}
#' }
#'
#
################################################################################
"accra"


################################################################################
#
#' A dataset of class SpatialPolygonsDataFrame that contains the coordinates of
#' the polygon of level 2 administrative unit of Antananarivo, Madagascar
#'
#' @format A dataset of class SpatialPolygonsDataFrame with 6 features with 10
#'     fields
#' \describe{
#' \item{\code{COMMUNE}}{Name of commune}
#' \item{\code{P_CODE}}{Commune postcode}
#' \item{\code{C_CODE}}{Commune code}
#' \item{\code{DISTRICT}}{Name of district}
#' \item{\code{DIST_PCODE}}{District postcode}
#' \item{\code{D_CODE}}{District code}
#' \item{\code{REGION}}{Name of region}
#' \item{\code{REG_PCODE}}{Region postcode}
#' \item{\code{R_CODE}}{Region code}
#' \item{\code{SOURCE}}{Source of data} 
#' }
#'
#'
#
################################################################################
"antananarivo"


################################################################################
#
#' A dataset of class SpatialPolygonsDataFrame that contains the coordinates of
#' the polygon of level 2 administrative unit of Dhaka, Bangladesh
#'
#' @format A dataset of class SpatialPolygonsDataFrame with 9 features with 11
#'     fields
#' \describe{
#' \item{\code{GEOCODE11}}{Geographical code}
#' \item{\code{LANDTYPE}}{Land type}
#' \item{\code{Division}}{Name of division}
#' \item{\code{District}}{Name of district}
#' \item{\code{Upazila}}{Name of upazila}
#' \item{\code{Union}}{Name of union}
#' \item{\code{UpzCode}}{Upazila code}
#' \item{\code{Shape_Leng}}{Length of polygon}
#' \item{\code{Shape_Area}}{Area of polygon}
#' \item{\code{surveyArea}}{Enumeration area}
#' \item{\code{noSurvey}}{Survey or no survey} 
#' }
#'
#
################################################################################
"dhaka"


################################################################################
#
#' A dataset of class SpatialPolygonsDataFrame that contains the coordinates of
#' the polygon of level 2 administrative unit of Lusaka, Zambia
#'
#' @format A dataset of class SpatialPolygonsDataFrame with 7 features with 5
#'     fields
#' \describe{
#' \item{\code{CODE}}{Code}
#' \item{\code{NAME}}{Name}
#' \item{\code{PROV_CODE}}{Province code}
#' \item{\code{DISTRICT_C}}{District code}
#' \item{\code{ID1}}{ID} 
#' }
#'     
#
################################################################################
"lusaka"


################################################################################
#
#' A dataset of class SpatialPolygonsDataFrame that contains the coordinates of
#' the polygon of level 2 administrative unit of Maputo, Mozambique
#' 
#' @format A dataset of class SpatialPolygonsDataFrame with 7 features with 15 
#'     fields
#' \describe{
#' \item{\code{ID_0}}{Administrative unit level 0 ID}
#' \item{\code{ISO}}{International Organization for Standardization (ISO) code}
#' \item{\code{NAME_0}}{Administrative unit level 0 name}
#' \item{\code{ID_1}}{Administrative unit level 1 ID}
#' \item{\code{NAME_1}}{Administrative unit level 1 name}
#' \item{\code{ID_2}}{Administrative unit level 2 ID}
#' \item{\code{NAME_2}}{Administrative unit level 2 name}
#' \item{\code{ID_3}}{Administrative unit level 3 ID}
#' \item{\code{NAME_3}}{Administrative unit level 3 name}
#' \item{\code{CCN_3}}{}
#' \item{\code{CCA_3}}{}
#' \item{\code{TYPE_3}}{Administrative unit level 3 type}
#' \item{\code{ENGTYPE_3}}{Administrative unit level 3 type (English)}
#' \item{\code{NL_NAME_3}}{Administrative unit level 3 name (National language)}
#' \item{\code{VARNAME_3}}{Administrative unit level 3 name variation} 
#' }
#'
#
################################################################################
"maputo"


################################################################################
#
#' A dataset of class SpatialPolygonsDataFrame that contains the coordinates of
#' the polygon of level 2 administrative unit of Nakuru, Kenya
#' 
#' @format A dataset of class SpatialPolygonsDataFrame with 5 features with 2
#'     fields
#' \describe{
#' \item{\code{LOCID}}{Location ID}
#' \item{\code{LOCNAME}}{Location name} 
#' }
#'
#
################################################################################
"nakuru"


################################################################################
#
#' A dataset of class SpatialPolygonsDataFrame that contains the coordinates of
#' the polygon of Upazila level administrative units of Dhaka, Bangladesh
#' 
#' @format A dataset of class SpatialPolygonsDataFrame with 5 features with 8
#'     fields
#' \describe{
#' \item{\code{Divisin}}{Division name}
#' \item{\code{Distrct}}{District name} 
#' \item{\code{Upazila}}{Upazila name}
#' \item{\code{UpzCode}}{Upazila code}
#' \item{\code{Shp_Lng}}{Length of shape}
#' \item{\code{Shap_Ar}}{Area of shape}
#' \item{\code{are_skm}}{Area size}
#' \item{\code{corprtn}}{City corporation to which upazila belongs to}
#' }
#'
#
################################################################################
"corporations"


################################################################################
#
#' A data frame containing WASH indicator codes and indicator names and other 
#' related information on the various indicators to be estimated
#' 
#' @format A data frame with 13 columns and 115 rows:
#' \describe{
#' \item{\code{varList}}{Indicator codes}
#' \item{\code{varFunction}}{Function to be applied to specific indicator}
#' \item{\code{varStatistic}}{Statistic to  use for estimating indicator}
#' \item{\code{varNames}}{Indicator description - full}
#' \item{\code{varShort}}{Indicator description - short}
#' \item{\code{varSet}}{Indicator set code}
#' \item{\code{varTitle}}{Indicator set name}
#' \item{\code{Bangladesh}}{Is indicator relevant for Bangladesh?}
#' \item{\code{Ghana}}{Is indicator relevant for Ghana?}
#' \item{\code{Mozambique}}{Is indicator relevant for Mozambique?}
#' \item{\code{Madagascar}}{Is indicator relevant for Madagascar?}
#' \item{\code{Kenya}}{Is indicator relevant for Kenya?}
#' \item{\code{Zambia}}{Is indicator relevant for Zambia?}
#' }
#'
#
################################################################################
"steerIndicators"


################################################################################
#
#' A data.frame containing results of survey estimates for the WSUP Bangladesh
#' survey
#' 
#' @format A data.frame with 11 columns and 2870 rows
#' 
#
################################################################################
"surveyResultsAll"


################################################################################
#
#' A data.frame containing recoded indicators data for the WSUP Bangladesh
#' survey
#' 
#' @format A data.frame with 162 columns and 1282 rows
#' 
#
################################################################################
"indicatorsDataAll"
validmeasures/wsup documentation built on Dec. 16, 2019, 4:50 a.m.