Code
library(tidyverse)
library(bslib)
library(shiny)
library(bsicons)
source("scripts/helper_functions.R")
# list of workshop IDs to filter results
<- c("2022-05-26-ucsb-twarc")
workshops
<- read_csv("data-joined/all_workshops.csv") %>%
results filter(workshop %in% workshops)
# Fix comma separator
<- results %>%
results mutate(findout_select.pre = str_replace_all(
findout_select.pre, "Twitter, Facebook, etc.",
"Twitter; Facebook; etc."))
<- results %>%
pre_survey select(ends_with(".pre"))
<- results %>%
post_survey select(ends_with(".post"))
<- sum(apply(post_survey, 1, function(row) all(is.na(row))))
n_pre <- sum(apply(pre_survey, 1, function(row) all(is.na(row))))
n_post <- nrow(results)
n_total <- nrow(results) - n_pre - n_post
n_both
layout_columns(
value_box(
title = "Total responses", value = n_total, ,
theme = NULL, showcase = bs_icon("people-fill"), showcase_layout = "left center",
full_screen = FALSE, fill = TRUE, height = NULL
),value_box(
title = "Both pre- and post-", value = n_both, , theme = NULL,
showcase = bs_icon("arrows-expand-vertical"), showcase_layout = "left center",
full_screen = FALSE, fill = TRUE, height = NULL
),value_box(
title = "Only pre-workshop", value = n_pre, ,
theme = NULL, showcase = bs_icon("arrow-left-short"), showcase_layout = "left center",
full_screen = FALSE, fill = TRUE, height = NULL
),value_box(
title = "Only post-workshop", value = n_post, , theme = NULL,
showcase = bs_icon("arrow-right-short"), showcase_layout = "left center",
full_screen = FALSE, fill = TRUE, height = NULL
) )
Total responses
14
Both pre- and post-
2
Only pre-workshop
11
Only post-workshop
1