Learn R Programming

rdhs (version 0.8.1)

extract_dhs: Extract Data

Description

Extracts data from your downloaded datasets according to a data.frame of requested survey variables or survey definitions

Usage

extract_dhs(questions, add_geo = FALSE)

Value

A list of `data.frames` for each survey data extracted.

Arguments

questions

Questions to be queried, in the format from search_variables or search_variable_labels

add_geo

Add geographic information to the extract. Defaut = `TRUE`

Details

Function to extract datasets using a set of survey questions as taken from the output from search_variables or search_variable_labels

Examples

Run this code
if (FALSE) {
# get the model datasets included with the package
model_datasets <- model_datasets

# download one of them
g <- get_datasets(dataset_filenames = model_datasets$FileName[1])

# create some terms of data me may want to extrac
st <- search_variable_labels(names(g), "bed net")

# and now extract it
ex <- extract_dhs(st)
}

Run the code above in your browser using DataLab