not_included/qb_update_scrap.R

library ( tidyverse)
library(haven)
imported_spss <- haven::read_spss("data-raw/ZA6863_v1-0-0.sav")

print_labels ( imported_spss$qa8_1)

spss_metadata <- data.frame (
	  gesis_name = sjlabelled::get_label (imported_spss ),
	  spss_name = names (imported_spss ),
	  spss_class = as.character(sapply(imported_spss, class)),
	  stringsAsFactors = FALSE
	)
gesis <- surveyreader:::gesis_qb

new_metadata <- full_join (spss_metadata, surveyreader:::gesis_qb,
           by = c("gesis_name", "spss_name", "spss_class"))


write_excel_csv(new_metadata, "data-raw/gesis_qb_update.csv")



spss_metadata_extended <- data.frame (
  gesis_name = sjlabelled::get_label (imported_spss ),
  spss_class = as.character(sapply(imported_spss , class)),
  new_class = NA,
  na_id = NA,
  format_spss = as.character(sapply(imported_spss, class)),
  number_lables = NA,
  sr_name = NA,
  ceemid = NA,
  sr_trend = NA,
  sr_policy	= NA,
  sr_enviornment	= NA,
  sr_education = NA,
  sr_econ = NA,
  sr_banking = NA,
  sr_democracy = NA,
  sr_europe = NA,
  sr_transport = NA,
  stringsAsFactors = FALSE
)
antaldaniel/surveyreader documentation built on May 16, 2019, 2:29 a.m.