Learn R Programming

surveyPrev (version 1.0.0)

getDHSdata: Download DHS survey data

Description

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

Usage

getDHSdata(country, indicator = NULL, Recode = NULL, year)

Value

This function returns the survey dataset that contains the indicator.

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.

Author

Qianyu Dong

Examples

Run this code
if (FALSE) {
# When indicator is known, download only the relevant file
dhsData <- getDHSdata(country = "Zambia",
                                 indicator = "ancvisit4+",
                                 year = 2018)

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

Run the code above in your browser using DataLab