label_data {dbGaPCheckup} | R Documentation |
Label the data
Description
Using the information in the data dictionary, this function adds non-missing information from the data dictionary as attributes to the data.
Usage
label_data(DD.dict, DS.data, non.NA.missing.codes = NA)
Arguments
DD.dict |
Data dictionary. |
DS.data |
Data set. |
non.NA.missing.codes |
A user-defined vector of numerical missing value codes (e.g., -9999). |
Value
A tibble containing the labelled data set, with the data dictionary information embedded as attributes and variables labelled using Haven SPSS conventions.
Examples
data(ExampleB)
DS_labelled_data <- label_data(DD.dict.B, DS.data.B, non.NA.missing.codes=c(-9999))
labelled::var_label(DS_labelled_data$SEX)
labelled::val_labels(DS_labelled_data$SEX)
attributes(DS_labelled_data$SEX)
labelled::na_values(DS_labelled_data$HX_DEPRESSION)
[Package dbGaPCheckup version 1.1.0 Index]