From 35d80e9d28d91cb78f2bb7ffc87c03dc5bca429c Mon Sep 17 00:00:00 2001 From: Maximilian Held Date: Wed, 10 Apr 2019 14:32:33 +0200 Subject: [PATCH] add english plots, opens #30 --- _site.yml | 17 ++++++++++++++- analysis.R | 60 ++++++++++++++++++++++++++++++++++------------------ appendix.Rmd | 38 +++++++++++++++++++++++++++++++-- render.R | 10 +++++++++ 4 files changed, 101 insertions(+), 24 deletions(-) diff --git a/_site.yml b/_site.yml index a3277e5..0dd88ee 100644 --- a/_site.yml +++ b/_site.yml @@ -23,7 +23,22 @@ navbar: text: Plots href: crowd_de_files/ - text: "Appendix (english)" - href: appendix.html + menu: + - icon: fa-html5 + text: HTML + href: appendix.html + - icon: fa-file-pdf + text: PDF (Springer) + href: appendix.pdf + - icon: fa-file-word + text: Word + href: appendix.docx + - icon: fa-file-code + text: LaTeX (Springer) + href: appendix.tex + - icon: fa-file-image + text: Plots + href: appendix_files/ right: - icon: fa-pen text: Edit diff --git a/analysis.R b/analysis.R index 3806e09..8a25f1e 100644 --- a/analysis.R +++ b/analysis.R @@ -4,18 +4,23 @@ plot_battery <- function(m, items = NULL, condition = "expect_crowd", lang = "en items <- colnames(m) } - quest %>% - dplyr::filter(section == condition) %>% - dplyr::filter(var %in% items) %>% - dplyr::mutate(var_german = stringr::str_wrap(string = var_german, width = width)) %>% - {.} -> df - long <- glue::glue_data( - .x = df, - "...{var_german}", - "({short_german}/{var})", - .sep = "\n" - ) - long <- rlang::set_names(x = long, nm = df$var) + if (lang == "de") { + quest %>% + dplyr::filter(section == condition) %>% + dplyr::filter(var %in% items) %>% + dplyr::mutate(var_german = stringr::str_wrap(string = var_german, width = width)) %>% + {.} -> df + long <- glue::glue_data( + .x = df, + "...{var_german}", + "({short_german}/{var})", + .sep = "\n" + ) + long <- rlang::set_names(x = long, nm = df$var) + } else { + long <- colnames(m) + } + # munge data m[, items] %>% @@ -59,7 +64,11 @@ plot_battery <- function(m, items = NULL, condition = "expect_crowd", lang = "en # color by platform, but no guide g <- g + scale_fill_discrete(name = "Platforms") + guides(fill = FALSE) } else { - g <- g + scale_fill_discrete(name = "Dimension der Leistungsgerechtigkeit") + if (lang == "de") { + g <- g + scale_fill_discrete(name = "Dimension der Leistungsgerechtigkeit") + } else { + g <- g + scale_fill_discrete(name = "Dimensions of Fairness") + } } if (lang == "de") { @@ -69,21 +78,30 @@ plot_battery <- function(m, items = NULL, condition = "expect_crowd", lang = "en } if (diff) { - g <- g + labs( - subtitle = "In meiner Erwerbsarbeit / In meiner Tätigkeit als CrowdworkerIn ist es mir wichtig, dass ..." - # subtitle = as_vector(quest[quest$section == "expect_crowd", "section_intro_german"])[1] - ) if (lang == "de") { + g <- g + labs( + subtitle = "In meiner Erwerbsarbeit / In meiner Tätigkeit als CrowdworkerIn ist es mir wichtig, dass ..." + # subtitle = as_vector(quest[quest$section == "expect_crowd", "section_intro_german"])[1] + ) g <- g + xlab("Unterschied in der Zustimmung") } else { + g <- g + labs( + subtitle = "In my job as a (crowd)worker, it is important to me that..." + ) g <- g + xlab("Difference in Agreement") } } else { - g <- g + labs( - subtitle = "Bei meiner Tätigkeit als CrowdworkerIn ist es mir wichtig, dass ..." - # subtitle = as_vector(quest[quest$section == "expect_crowd", "section_intro_german"])[1] - ) + if (lang == "de") { + g <- g + labs( + subtitle = "Bei meiner Tätigkeit als CrowdworkerIn ist es mir wichtig, dass ..." + ) + } else { + g <- g + labs( + subtitle = "In my job as a (crowd)worker, it is important to me that ..." + ) + } + g <- g + xlab(NULL) g <- g + theme(axis.text.x = element_text(angle = 90, vjust = 0.5, hjust = 1)) if (lang == "de") { diff --git a/appendix.Rmd b/appendix.Rmd index 801ffe6..028f767 100644 --- a/appendix.Rmd +++ b/appendix.Rmd @@ -22,6 +22,7 @@ output: toc_float: no smart: yes fig_caption: yes +always_allow_html: yes --- ```{r import, include=FALSE, eval=FALSE} @@ -185,8 +186,29 @@ Such subtle shifts in emphasis may contribute small shifts in ratings, or may, i ```{r battery, fig.cap=paste(c("Work", "Crowdwork"), "Expectations (Heatmap of Counts)"), fig.width=12, fig.height=10} -plot_battery(m = crowddata$exp_work, condition = "expect_work") -plot_battery(m = crowddata$exp_crowd, condition = "expect_crowd") +plot_battery(m = crowddata$exp_work, condition = "expect_work", lang = "en") +plot_battery(m = crowddata$exp_crowd, condition = "expect_crowd", lang = "en") +``` + +```{r crowd, fig.cap="Crowdwork Expectations (Heatmap of Counts)", fig.width=12, fig.height=10} +interesting <- NULL +interesting$Renumeration <- c("wage_organisation", "wage") +interesting$Briefing <- c("transparent_tasks", "expectations") +interesting$Assessment <- c( + "dissent_eval", + "consistent_eval", + "influence_eval", + "evaluation", + "transparent_eval" +) +interesting$Planning <- c("safe_job") +plot_battery( + m = crowddata$exp_crowd, + items = unlist(interesting), + width = 55, + lang = "en", + concepts = interesting +) ``` The above figures \@ref(fig:items-scores) and \@ref(fig:battery) show relatively little variance within and across the measured 28 variables in both contexts. @@ -202,6 +224,18 @@ plot_battery( ) ``` +```{r diff, fig.cap="Expectations Towards Regular Employment - Crowdwork", fig.width=12, fig.height=10} +m <- crowddata$exp_work - crowddata$exp_crowd +plot_battery( + m = m, + items = unlist(interesting), + width = 55, + lang = "en", + concepts = interesting, + diff = TRUE +) +``` + There is also not much difference in the rankings of the variable compared between the two contexts. In figure \@ref(fig:difference), the individual crowdwork scores are subtracted from the work scores, and the results are then counted. For example, the counts for a `-3` in figure \@ref(fig:difference) is the number of participants who rate the item in question *3* levels higher in the crowd than in the regular work context. diff --git a/render.R b/render.R index 7f1a465..e9d8ce1 100644 --- a/render.R +++ b/render.R @@ -9,3 +9,13 @@ rmarkdown::render( output_format = bookdown::word_document2(), output_dir = "_site" ) +rmarkdown::render( + input = "appendix.Rmd", + output_format = bookdown::pdf_book(base_format = rticles::springer_article), + output_dir = "_site" +) +rmarkdown::render( + input = "appendix.Rmd", + output_format = bookdown::word_document2(), + output_dir = "_site" +)