From 999e7ff623588a82710b9d5a2c617e3ef3d51c49 Mon Sep 17 00:00:00 2001 From: LynnINBO Date: Wed, 8 Jan 2025 09:45:49 +0100 Subject: [PATCH] Clean Q1 #1 --- Interim/dummy_question1.csv | 11 +++++++++++ Script/1-data-prep.Rmd | 12 +++++++++--- 2 files changed, 20 insertions(+), 3 deletions(-) create mode 100644 Interim/dummy_question1.csv diff --git a/Interim/dummy_question1.csv b/Interim/dummy_question1.csv new file mode 100644 index 0000000..90c88d0 --- /dev/null +++ b/Interim/dummy_question1.csv @@ -0,0 +1,11 @@ +respondent_id;question;response +114762892402;What country/countries are your activities based in? Multiple answers are possible.;Belgium +114761515324;What country/countries are your activities based in? Multiple answers are possible.;Belgium +114761515324;What country/countries are your activities based in? Multiple answers are possible.;Sweden +114761515324;What country/countries are your activities based in? Multiple answers are possible.;Plopsaland +114761370340;What country/countries are your activities based in? Multiple answers are possible.;North Macedonia +114761370340;What country/countries are your activities based in? Multiple answers are possible.;Norway +114761367399;What country/countries are your activities based in? Multiple answers are possible.;Andorra +114761367399;What country/countries are your activities based in? Multiple answers are possible.;Bulgaria +114761367399;What country/countries are your activities based in? Multiple answers are possible.;Liechtenstein +114761357836;What country/countries are your activities based in? Multiple answers are possible.;Norway diff --git a/Script/1-data-prep.Rmd b/Script/1-data-prep.Rmd index 123c946..1a25f9f 100644 --- a/Script/1-data-prep.Rmd +++ b/Script/1-data-prep.Rmd @@ -80,9 +80,15 @@ remove(i, name, question) # Get survey ID ```{r} -surv <- surveymonkey::browse_surveys(title = "Indentifying data sharing issues regarding camera trap data in Europe -- dummy version", - oauth_token = token) -survID <- c(surv$id) +Q1 <- q1 %>% + pivot_longer(!respondent_id, names_to = "long_answer", values_to = "response") %>% + filter(!is.na(response)) %>% + mutate(question = qs$question[qs$code == "q1"]) %>% + mutate(nchar = nchar(question)) %>% + mutate(long_answer = substring(long_answer, nchar + 4)) %>% + select(respondent_id, question, response) %>% + write_csv2("./Interim/dummy_question1.csv") +remove(q1) ``` # Get the whole survey