Code
library(tidyverse)
library(bslib)
library(shiny)
library(bsicons)
source("scripts/helper_functions.R")
# list of workshop IDs to filter results
<- c("2024-06-10-ucsb-geospatial", "2024-06-04-ucsb-containers", "2024-05-01-ucsb-r")
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
49
Both pre- and post-
15
Only pre-workshop
25
Only post-workshop
9