Skip to contents

Query DHS API

Functions for interacting with each of the DHS API endpoints. They all start ‘dhs_’ for simplicity.

dhs_countries()
API request of DHS Countries
dhs_data()
API request of DHS Indicator Data
dhs_data_updates()
API request of DHS Data Updates
dhs_datasets()
API request of DHS Datasets
dhs_geometry()
API request of DHS Geometry
dhs_indicators()
API request of DHS Indicators
dhs_info()
API request of DHS Info
dhs_publications()
API request of DHS Publications
dhs_survey_characteristics()
API request of DHS Survey Characteristics
dhs_surveys()
API request of DHS Surveys
dhs_tags()
API request of DHS Tags
dhs_ui_updates()
API request of DHS UI Updates

Set up DHS login credentials

“Set our credentials for logging into the DHS website. This creates in the backend a rdhs client for downloading datasets, querying survey variables and extracting data.”

set_rdhs_config()
Set rdhs config
get_rdhs_config()
Get rdhs config
update_rdhs_config()
Update your current rdhs config
client_dhs()
Make a dhs client

User Interface

Functions to download, search and interact with downloaded datasets

extract_dhs()
Extract Data
get_available_datasets()
Get Available Datasets
get_datasets()
Get Datasets
get_downloaded_datasets()
Get Downloaded Datasets
search_variables()
Search Survey Variables
search_variable_labels()
Search Survey Variable Definitions
download_boundaries()
DHS Spatial Boundaries

Downstream Dataset Helper Functions

Tools to help combine extracted datasets, as well as extract and apend dataset variable names and definitions

rbind_labelled()
Combine data frames with columns of class `labelled`
get_variable_labels()
Get Survey Variable Labels
data_and_labels()
Create list of dataset and its variable names
delabel_df()
convert labelled data frame to data frame of just characters

DHS Dataset Parsers

Custom built parsers for handling flat ASCII and stata DHS datasets

read_dhs_flat()
Read DHS flat file data set
parse_dcf() parse_sps() parse_do()
Parse fixed-width file metadata
read_dhs_dta()
Read DHS Stata data set