# import SPSS data set
# mydat <- read_spss("my_spss_data.sav", enc="UTF-8")
# retrieve variable labels
# mydat.var <- get_var_labels(mydat)
# retrieve value labels
# mydat.val <- get_val_labels(mydat)
data(efc)
get_val_labels(efc$e42dep)
# simple barplot
barplot(table(efc$e42dep))
# get value labels to annotate barplot
barplot(table(efc$e42dep),
names.arg = get_val_labels(efc$e42dep),
main = get_var_labels(efc$e42dep))
Run the code above in your browser using DataLab