Created
January 18, 2024 15:44
-
-
Save vanatteveldt/e668a1a698e82802968cbb6c6fdfe01e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(tidyverse) | |
get_label = function(var) tibble(var=var, label=d[[var]] %>% attr(which = "label")) | |
map(colnames(d), get_label) |> list_rbind() | |
var = "sex_rec" | |
get_value_labels <- function(var) { | |
value_labels <- attr(d[[var]], which="labels") | |
tibble(var=var, value=value_labels, label=names(value_labels)) | |
} | |
map(colnames(d), get_value_labels) |> list_rbind() | |
Extract value labels: | |
#head(d %>% surveytoolbox::extract_vallab(“vaiablename"),15) | |
d <- haven::read_sav("data/raw/NLTK23-10_Mariken_wave 1_gedeeld_231018.sav") | |
View(d) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment