get_api_table {surveyPrev} | R Documentation |
Function to obtain subnational estimates from DHS API
Description
Function to obtain subnational estimates from DHS API
Usage
get_api_table(country, survey, indicator, simplify = TRUE)
Arguments
country |
A character string of keys at: https://api.dhsprogram.com/rest/dhs/countries?returnFields=CountryName,DHS_CountryCode&f=html |
survey |
A character string of keys at: https://api.dhsprogram.com/rest/dhs/surveys?returnFields=SurveyId,SurveyYearLabel,SurveyType,CountryName&f=html |
indicator |
A character string of keys at: https://api.dhsprogram.com/rest/dhs/indicators?returnFields=IndicatorId,Label,Definition&f=html |
simplify |
if TRUE only the value and region index is returned. |
Value
a data frame of the DHS indicator estimates
Examples
## Not run:
# country: Zambia
# survey: 2018 DHS
# indicator: Percentage of children stunted
# (below -2 SD of height for age
# according to the WHO standard)
dhs_table <- get_api_table(country = "ZM",
survey = "ZM2018DHS",
indicator = "CN_NUTS_C_HA2",
simplify = TRUE)
dhs_table
## End(Not run)
[Package surveyPrev version 1.0.0 Index]