
Retrieve labels from labeled data frames derived from SPSS .sav files
Source: R/get_labels.R, R/get_labs.R
get_labels.RdConvenience function to extract labels from labelled data frames or objects,
usually from survey data captured in Qualtrics imported into R using the haven package.
Examples
label_example <-
structure(
data.frame(
Q1 = c("U.S.", "Canada", "U.S.", "Germany", "U.S.")
),
label = "What country do you live in?"
)
get_labels(label_example)
#> [1] "What country do you live in?"
label_example <-
structure(
data.frame(
Q1 = c("U.S.", "Canada", "U.S.", "Germany", "U.S.")
),
label = "What country do you live in?"
)
get_labels(label_example)
#> [1] "What country do you live in?"