Skip to content
Snippets Groups Projects
Commit 20ee4e9d authored by richard beer's avatar richard beer
Browse files

Neuer Aufgabe -> neues Skript

parent 793be844
Branches master
No related tags found
No related merge requests found
# preparatory work ####
# reset workspace #
rm(list = ls())
# setwd #
setwd("P:/IMEBI/DigiHero_Teilnehmerdaten/Massenmails/tokenaufbereiter")
suppressWarnings({
suppressMessages({
library(readxl)
library(writexl)
library(tidyverse)
library(lubridate)
#source("./function_load.R")
source("./download_get_key.R")
})
})
#Umfragen ID:
# 433442
atr <- c(
"emailstatus",
"language"
)
ls_433442_0 <- get_responses(433442, iFromResponseID =1,iToResponseID=15000)
ls_433442_1 <- get_responses(433442, iFromResponseID =15001,iToResponseID=25000)
ls_433442_2 <- get_responses(433442, iFromResponseID =25001,iToResponseID=35000)
ls_433442_3 <- get_responses(433442, iFromResponseID =35001,iToResponseID=45000)
ls_433442_4 <- get_responses(433442, iFromResponseID =45001,iToResponseID=55000)
ls_433442_5 <- get_responses(433442, iFromResponseID =55001,iToResponseID=65000)
ls_433442_6 <- get_responses(433442, iFromResponseID =65001,iToResponseID=75000)
ls_433442_7 <- get_responses(433442, iFromResponseID =75001,iToResponseID=85000)
ls_433442_8 <- get_responses(433442, iFromResponseID =85001,iToResponseID=95000)
filtered_data_frames <- Filter(function(x) is.data.frame(get(x)), ls())
# die "values" zu "Data" machen und die participant_info entschachteln
data_frames_list <- lapply(filtered_data_frames, get)
suppressWarnings({
data_frames_list2 <- lapply(data_frames_list, unnest)
})
combined_df <- do.call(rbind, data_frames_list2)
tokenlist <- read_xlsx("G:/IMEBI_POST/Kunze.Mareike/token.xlsx")
result <- left_join(tokenlist, combined_df,by = c("originaltoken" = "token"))
result <- result %>% select(-id, -submitdate,-lastpage,-startlanguage,-seed,-startdate,-datestamp,-ipaddr,-FB0Q7q1,-FB0Q7q2.1.,-FB0Q7q2.2.)
print(result)
write.csv(result,paste0("./Adressen_nach_tokenliste_",format(Sys.Date(), "%Y_%m_%d"),".csv"), row.names = F)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment