Return variable labels from a dataset

get_variable_labels(dataset, return_all = TRUE)

Arguments

dataset Can be either the file path to a dataset, the dataset as a data.frame or the filenames of datasets. See details for more information Logical whether to return all variables (TRUE) or only those with labels.

Value

A data.frame consisting of the variable name and labels.

Details

Returns variable names and their labels from a dataset. You can pass for the data argument any of the following:

• The file path to a saved dataset. This would be the direct output of get_datasets

• A read in dataset, i.e. produced by using readRDS to load a dataset from a file path produced by get_datasets

• Dataset filenames. These can be found as one of the returned fields from dhs_datasets. If these datasets have not been downloaded before this will download them for you.

Examples

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