getDHSdata: Download DHS survey data

View source: R/getDHSdata.R

getDHSdataR Documentation

Download DHS survey data

Description

This function downloads DHS data for a particular country and survey.

Usage

getDHSdata(country, indicator = NULL, Recode = NULL, year, SurveyType = "DHS")

Arguments

country

Country name.

indicator

Indicator of interests. Current list of supported indicators include: "womananemia", "ancvisit4+", "stunting", "wasting", "DPT3".

Recode

Types of dhs Recode

year

Year the survey conducted.

SurveyType

Type of survey ("DHS","SPE"). Default is "DHS".

Value

This function returns the survey dataset that contains the indicator.

Author(s)

Qianyu Dong

Examples

## Not run: 
# When indicator is known, download only the relevant file
# "RH_ANCN_W_N4P" is an indicator for having more than four ANC visits.
#  In previous versions of the package, it is labeled "ancvisit4+".
dhsData <- getDHSdata(country = "Zambia",
                                 indicator = "RH_ANCN_W_N4P",
                                 year = 2018)

# When indicator is NULL or not recognized, download all files
dhsData <- getDHSdata(country = "Zambia",
                                 indicator = NULL,
                                 year = 2018)
names(dhsData)

## End(Not run)


surveyPrev documentation built on June 19, 2026, 5:06 p.m.