Code
library(tidyverse)
library(bslib)
library(shiny)
library(bsicons)
source("scripts/helper_functions.R")
# list of workshop IDs to filter results
workshops <- c("2025-02-03-ucsb-computing")
results <- read_csv("data-joined/all_workshops.csv") %>%
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."))
pre_survey <- results %>%
select(ends_with(".pre"))
post_survey <- results %>%
select(ends_with(".post"))
n_pre <- sum(apply(post_survey, 1, function(row) all(is.na(row))))
n_post <- sum(apply(pre_survey, 1, function(row) all(is.na(row))))
n_total <- nrow(results)
n_both <- nrow(results) - n_pre - n_post
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
29
Both pre- and post-
7
Only pre-workshop
17
Only post-workshop
5








