---
title: "edc_2025_set_times"
author: "Joe"
date: "`r Sys.Date()`"
editor: source
format:
html:
theme: quartz
#fontcolor: black
toc: true
toc-location: left
code-fold: true
code-tools: true
df-print: kable
fig-width: 13
fig-height: 8
embed-resources: true
grid:
body-width: 2000px
execute:
warning: false
---
```{r}
start_time <- Sys.time()
tidy_packages <- c("readr","tidyr","stringr","ggplot2","dplyr")
required_packages <- c(
"gt",
"googlesheets4",
"lubridate",
"plotly",
tidy_packages
)
invisible(lapply(required_packages, library, character.only=TRUE))
options(scipen = 10L)
# Wong, B. Points of view: Color blindness. Nat Methods (2011).
bla <- '#000000'
blu <- '#0072b2'
grb <- '#56b4e9'
lir <- '#cc79a7'
gre <- '#009e73'
red <- '#d55e00'
org <- '#e69f00'
yel <- '#f0e442'
gry <- '#BBBBBB'
jam_cols <- c(red,blu,gre,org,grb,lir,gry,bla)
jam_shapes <- c(21,22,23,24,25)
options(ggplot2.discrete.colour = jam_cols)
options(ggplot2.discrete.fill = jam_cols)
jam_theme <- theme_minimal() +
theme(text=element_text(size=14),axis.text=element_text(size=12),
axis.title.y = element_text(margin = margin(t = 0, r = 10, b = 0, l = 0)),
axis.title.x = element_text(margin = margin(t = 10, r = 0, b = 0, l = 0))) +
theme(plot.background = element_rect(fill = "#eff3ff"))
jam_theme_bw <- theme_bw() +
theme(text=element_text(size=14),axis.text=element_text(size=12),
axis.title.y = element_text(margin = margin(t = 0, r = 10, b = 0, l = 0)),
axis.title.x = element_text(margin = margin(t = 10, r = 0, b = 0, l = 0))) +
theme(plot.background = element_rect(fill = "#eff3ff"))
jam_theme_45 <- theme(axis.text.x = element_text(angle = 45, hjust = 1), plot.margin = margin(10, 10, 10, 50))
# Create color pallete based on lineup image @ https://coolors.co/image-picker
my_cols <- c("#52BFEC","#AA1880","#EC0059","#08BCDF","#4C1064", "#FF00BC", "#2249CD","#53007D", "#FF6B02","#B319B2","#EAE100", "#BF068F")
```
# Data Munge
```{r}
set_times_full <- read_sheet("https://docs.google.com/spreadsheets/d/12Mrp81DWWDFkI8LRtVjuDONh2stZYRVY8VxrpvtcrLM/edit?usp=sharing", sheet = "set_times", col_types = "ccccc")
names(set_times_full) <- snakecase::to_snake_case(names(set_times_full))
set_times <- set_times_full |>
mutate(day = case_when(day == "Friday" ~ "2025-05-16",
day == "Saturday" ~ "2025-05-17",
day == "Sunday" ~ "2025-05-18"),
start_time = ifelse(str_detect(start_time, ":"), start_time, paste0(start_time, ":00")),
stop_time = ifelse(str_detect(stop_time, ":"), stop_time, paste0(stop_time, ":00")),
start_time = as_datetime(paste0(day, " ", paste0(start_time, ":00"))),
stop_time = as_datetime(paste0(day, " ", paste0(stop_time, ":00"))))
set_times <- set_times |>
mutate(start_time = case_when(day == "2025-05-16" & start_time > as_datetime("2025-05-16 06:00:00") ~ start_time + hours(12),
day == "2025-05-17" & start_time > as_datetime("2025-05-17 06:00:00") ~ start_time + hours(12),
day == "2025-05-18" & start_time > as_datetime("2025-05-18 06:00:00") ~ start_time + hours(12),
.default = start_time),
stop_time = case_when(day == "2025-05-16" & stop_time > as_datetime("2025-05-16 06:00:00") ~ stop_time + hours(12),
day == "2025-05-17" & stop_time > as_datetime("2025-05-17 06:00:00") ~ stop_time + hours(12),
day == "2025-05-18" & stop_time > as_datetime("2025-05-18 06:00:00") ~ stop_time + hours(12),
.default = stop_time))
set_times <- set_times |>
mutate(start_time = case_when(day == "2025-05-16" & start_time < as_datetime("2025-05-16 18:00:00") ~ start_time + days(1),
day == "2025-05-17" & start_time < as_datetime("2025-05-17 18:00:00") ~ start_time + days(1),
day == "2025-05-18" & start_time < as_datetime("2025-05-18 18:00:00") ~ start_time + days(1),
.default = start_time),
stop_time = case_when(day == "2025-05-16" & stop_time < as_datetime("2025-05-16 18:00:00") ~ stop_time + days(1),
day == "2025-05-17" & stop_time < as_datetime("2025-05-17 18:00:00") ~ stop_time + days(1),
day == "2025-05-18" & stop_time < as_datetime("2025-05-18 18:00:00") ~ stop_time + days(1),
.default = stop_time)) |>
mutate(start_time_12hr = format(start_time, "%I:%M %p"),
stop_time_12hr = format(stop_time, "%I:%M %p")) |>
mutate(time_label_12hr = paste0(start_time_12hr, " - ", stop_time_12hr),
time_label_position = start_time + (difftime(stop_time, start_time) /2)) |>
arrange(start_time) |>
mutate(dupl = if_else(duplicated(artist), 1, 0)) |>
group_by(artist) |>
mutate(dupl = cumsum(dupl),
artist = paste(artist, dupl, sep = " - "),
artist = str_remove(artist, " - 0")) |>
select(-dupl) |>
ungroup()
set_times <- set_times |>
mutate(artist = factor(artist, levels = rev(set_times$artist)))
big_stages <- c("bassPOD","circuitGROUNDS","cosmicMEADOW","kineticFIELD","neonGARDEN","quantumVALLEY","stereoBLOOM","wasteLAND")
#small_stages <- c("bassPOD","BeatboxArtCar","bionicJUNGLE","BlacklightBar","circuitGROUNDS","cosmicMEADOW","ForestHouse","kineticFIELD","Metaphoenix","neonGARDEN","quantumVALLEY","stereoBLOOM","Ubuntu","wasteLAND","yeEDC!")
set_times_16 <- filter(set_times, day == "2025-05-16")#, stage %in% big_stages)
set_times_17 <- filter(set_times, day == "2025-05-17")#, stage %in% big_stages)
set_times_18 <- filter(set_times, day == "2025-05-18")#, stage %in% big_stages)
# filter(set_times, stage == "bassPOD")
# filter(set_times, day == "2025-05-16", stage == "bassPOD")
votes <- read_sheet("https://docs.google.com/spreadsheets/d/12Mrp81DWWDFkI8LRtVjuDONh2stZYRVY8VxrpvtcrLM/edit?usp=sharing", sheet = "votes", col_types = "cccccccccccc")
names(votes) <- snakecase::to_snake_case(names(votes))
votes <- votes |>
mutate(dupl = if_else(duplicated(artist), 1, 0)) |>
group_by(artist) |>
mutate(dupl = cumsum(dupl),
artist = paste(artist, dupl, sep = " - "),
artist = str_remove(artist, " - 0")) |>
select(-dupl) |>
ungroup()
```
```{r}
voter.stats <- function(person){
voter <- filter(votes, !is.na(!!sym(person))) |>
inner_join(set_times)
d1 <- tibble(n = sum(as.numeric(voter[[person]]))) |>
gt() |>
tab_header("total votes")
print(htmltools::tagList(d1))
d1 <- voter |>
count(!!sym(person)) |>
gt() |>
tab_header("number of votes 1 through 5")
print(htmltools::tagList(d1))
d1 <- voter |>
group_by(stage) |>
summarise(n = sum(as.numeric(!!sym(person)))) |>
arrange(desc(n)) |>
gt() |>
tab_header("number of votes by stage")
print(htmltools::tagList(d1))
d1 <- voter |>
group_by(day) |>
summarise(n = sum(as.numeric(!!sym(person)))) |>
arrange(day) |>
gt() |>
tab_header("number of votes by day")
print(htmltools::tagList(d1))
d1 <- voter |>
filter(as.numeric(!!sym(person)) >=4) |>
select(artist, all_of(person), stage, day, start_time_12hr, stop_time_12hr) |>
arrange(day, start_time_12hr) |>
gt() |>
tab_header("artists with 4s and 5s")
print(htmltools::tagList(d1))
}
vote_colors <- c("#feebe2","#fbb4b9","#f768a1","#c51b8a","#7a0177")
plot.personal.conflicts <- function(person){
i_set_times <- set_times_16
voter <- filter(votes, !is.na(!!sym(person))) |>
inner_join(i_set_times)
i_set_times <- i_set_times |>
filter(artist %in% voter$artist)
p1 <- ggplot() +
geom_segment(data=i_set_times, aes(x = as_datetime("2025-05-16 19:00:00"), xend = as_datetime("2025-05-17 06:00:00"),
y= artist, yend = artist), linewidth = 1, color = gry) +
geom_segment(data=i_set_times, aes(x = start_time, xend = stop_time, y = artist), linewidth = 2, color = gry) +
geom_label(data=i_set_times, aes(label=time_label_12hr, x=time_label_position, y = artist), size=3.5) +
geom_rect(data=voter, aes(xmin = start_time, xmax= stop_time, ymin = -Inf, ymax = Inf, fill = !!sym(person)), alpha = 0.5) +
#geom_rect(data=kimiko, aes(xmin = start_time, xmax= stop_time, ymin = -Inf, ymax = Inf, fill = schedule_joe), alpha = 0.3) +
facet_grid(rows = vars(stage), scales = "free") +
scale_x_datetime(date_breaks = "1 hour", date_labels = "%I %M %p") +
scale_fill_manual(values = vote_colors) +
jam_theme_bw +
jam_theme_45 +
ylab("") + xlab("") +
ggtitle("Friday")
print(p1)
i_set_times <- set_times_17
voter <- filter(votes, !is.na(!!sym(person))) |>
inner_join(i_set_times)
i_set_times <- i_set_times |>
filter(artist %in% voter$artist)
p1 <- ggplot() +
geom_segment(data=i_set_times, aes(x = as_datetime("2025-05-17 19:00:00"), xend = as_datetime("2025-05-18 06:00:00"),
y= artist, yend = artist), linewidth = 1, color = gry) +
geom_segment(data=i_set_times, aes(x = start_time, xend = stop_time, y = artist), linewidth = 2, color = gry) +
geom_label(data=i_set_times, aes(label=time_label_12hr, x=time_label_position, y = artist), size=3.5) +
geom_rect(data=voter, aes(xmin = start_time, xmax= stop_time, ymin = -Inf, ymax = Inf, fill = !!sym(person)), alpha = 0.5) +
#geom_rect(data=kimiko, aes(xmin = start_time, xmax= stop_time, ymin = -Inf, ymax = Inf, fill = schedule_joe), alpha = 0.3) +
facet_grid(rows = vars(stage), scales = "free") +
scale_x_datetime(date_breaks = "1 hour", date_labels = "%I %M %p") +
scale_fill_manual(values = vote_colors) +
jam_theme_bw +
jam_theme_45 +
ylab("") + xlab("") +
ggtitle("Saturday")
print(p1)
i_set_times <- set_times_18
voter <- filter(votes, !is.na(!!sym(person))) |>
inner_join(i_set_times)
i_set_times <- i_set_times |>
filter(artist %in% voter$artist)
p1 <- ggplot() +
geom_segment(data=i_set_times, aes(x = as_datetime("2025-05-18 19:00:00"), xend = as_datetime("2025-05-19 06:00:00"),
y= artist, yend = artist), linewidth = 1, color = gry) +
geom_segment(data=i_set_times, aes(x = start_time, xend = stop_time, y = artist), linewidth = 2, color = gry) +
geom_label(data=i_set_times, aes(label=time_label_12hr, x=time_label_position, y = artist), size=3.5) +
geom_rect(data=voter, aes(xmin = start_time, xmax= stop_time, ymin = -Inf, ymax = Inf, fill = !!sym(person)), alpha = 0.5) +
#geom_rect(data=kimiko, aes(xmin = start_time, xmax= stop_time, ymin = -Inf, ymax = Inf, fill = schedule_joe), alpha = 0.3) +
facet_grid(rows = vars(stage), scales = "free") +
scale_x_datetime(date_breaks = "1 hour", date_labels = "%I %M %p") +
scale_fill_manual(values = vote_colors) +
jam_theme_bw +
jam_theme_45 +
ylab("") + xlab("") +
ggtitle("Sunday")
print(p1)
}
```
# Kimiko
```{r}
#| fig-width: 14
#| fig-height: 10
#| results: asis
person <- "votes_kimiko"
voter.stats(person)
plot.personal.conflicts(person)
```
# Joe
```{r}
#| fig-width: 14
#| fig-height: 10
#| results: asis
person <- "votes_joe"
voter.stats(person)
plot.personal.conflicts(person)
```
# Steve
```{r}
#| fig-width: 14
#| fig-height: 10
#| results: asis
person <- "votes_steve"
voter.stats(person)
plot.personal.conflicts(person)
```
# Katie
Required listening for Katie!!!!!
ISOKNOCK (Knock2 is better than ISOxo but their collabs are good too, especially with RL Grime)
[Link to Spotify playlist](https://open.spotify.com/playlist/1ttxzX2igUmUJ0BfDKAZCw?si=9d9007d18e70454f)
```{r}
#| fig-width: 14
#| fig-height: 10
#| results: asis
person <- "votes_katie"
voter.stats(person)
plot.personal.conflicts(person)
```
# Chantel
```{r}
#| fig-width: 14
#| fig-height: 10
#| results: asis
person <- "votes_chantel"
voter.stats(person)
plot.personal.conflicts(person)
```
# Group Votes
```{r}
plot.group.conflicts <- function(){
i_set_times <- set_times_16
group_voter <- select(votes, c(artist, contains("votes"))) |>
pivot_longer(!artist, names_to = "voter", values_to = "vote") |>
filter(!is.na(vote)) |>
group_by(artist) |>
summarise(sum_votes = sum(as.numeric(vote), na.rm = T)) |>
inner_join(i_set_times)
i_set_times <- i_set_times |>
filter(artist %in% group_voter$artist)
p1 <- ggplot() +
geom_segment(data=i_set_times, aes(x = as_datetime("2025-05-16 19:00:00"), xend = as_datetime("2025-05-17 06:00:00"),
y= artist, yend = artist), linewidth = 1, color = gry) +
geom_segment(data=i_set_times, aes(x = start_time, xend = stop_time, y = artist), linewidth = 2, color = gry) +
geom_label(data=i_set_times, aes(label=time_label_12hr, x=time_label_position, y = artist), size=3.5) +
geom_rect(data=group_voter, aes(xmin = start_time, xmax= stop_time, ymin = -Inf, ymax = Inf, fill = sum_votes), alpha = 0.5) +
facet_grid(rows = vars(stage), scales = "free") +
scale_x_datetime(date_breaks = "1 hour", date_labels = "%I %M %p") +
scale_fill_gradient(low = "#feebe2", high = "#7a0177") +
jam_theme_bw +
jam_theme_45 +
ylab("") + xlab("") +
ggtitle("Friday")
print(p1)
i_set_times <- set_times_17
group_voter <- select(votes, c(artist, contains("votes"))) |>
pivot_longer(!artist, names_to = "voter", values_to = "vote") |>
filter(!is.na(vote)) |>
group_by(artist) |>
summarise(sum_votes = sum(as.numeric(vote), na.rm = T)) |>
inner_join(i_set_times)
i_set_times <- i_set_times |>
filter(artist %in% group_voter$artist)
p1 <- ggplot() +
geom_segment(data=i_set_times, aes(x = as_datetime("2025-05-17 19:00:00"), xend = as_datetime("2025-05-18 06:00:00"),
y= artist, yend = artist), linewidth = 1, color = gry) +
geom_segment(data=i_set_times, aes(x = start_time, xend = stop_time, y = artist), linewidth = 2, color = gry) +
geom_label(data=i_set_times, aes(label=time_label_12hr, x=time_label_position, y = artist), size=3.5) +
geom_rect(data=group_voter, aes(xmin = start_time, xmax= stop_time, ymin = -Inf, ymax = Inf, fill = sum_votes), alpha = 0.5) +
#geom_rect(data=kimiko, aes(xmin = start_time, xmax= stop_time, ymin = -Inf, ymax = Inf, fill = schedule_joe), alpha = 0.3) +
facet_grid(rows = vars(stage), scales = "free") +
scale_x_datetime(date_breaks = "1 hour", date_labels = "%I %M %p") +
scale_fill_gradient(low = "#feebe2", high = "#7a0177") +
jam_theme_bw +
jam_theme_45 +
ylab("") + xlab("") +
ggtitle("Saturday")
print(p1)
i_set_times <- set_times_18
group_voter <- select(votes, c(artist, contains("votes"))) |>
pivot_longer(!artist, names_to = "voter", values_to = "vote") |>
filter(!is.na(vote)) |>
group_by(artist) |>
summarise(sum_votes = sum(as.numeric(vote), na.rm = T)) |>
inner_join(i_set_times)
i_set_times <- i_set_times |>
filter(artist %in% group_voter$artist)
p1 <- ggplot() +
geom_segment(data=i_set_times, aes(x = as_datetime("2025-05-18 19:00:00"), xend = as_datetime("2025-05-19 06:00:00"),
y= artist, yend = artist), linewidth = 1, color = gry) +
geom_segment(data=i_set_times, aes(x = start_time, xend = stop_time, y = artist), linewidth = 2, color = gry) +
geom_label(data=i_set_times, aes(label=time_label_12hr, x=time_label_position, y = artist), size=3.5) +
geom_rect(data=group_voter, aes(xmin = start_time, xmax= stop_time, ymin = -Inf, ymax = Inf, fill = sum_votes), alpha = 0.5) +
#geom_rect(data=kimiko, aes(xmin = start_time, xmax= stop_time, ymin = -Inf, ymax = Inf, fill = schedule_joe), alpha = 0.3) +
facet_grid(rows = vars(stage), scales = "free") +
scale_x_datetime(date_breaks = "1 hour", date_labels = "%I %M %p") +
scale_fill_gradient(low = "#feebe2", high = "#7a0177") +
jam_theme_bw +
jam_theme_45 +
ylab("") + xlab("") +
ggtitle("Sunday")
print(p1)
}
```
```{r}
#| fig-width: 14
#| fig-height: 14
#| results: asis
plot.group.conflicts()
```
# Festiplanner
Fesitplanner [link](https://festiplannr.com/edclv25/s/new)



# Notes
```{r}
#| eval: false
set_times <- readxl::read_xlsx("C:/Users/joseph.mcgirr/Personal/R_fun/edc_2025/example_set_times.xlsx") |>
arrange(start_time) |>
mutate(schedule_joe = as.character(schedule_joe),
schedule_kimiko = as.character(schedule_kimiko))
date(set_times$start_time) <- set_times$day
date(set_times$stop_time) <- set_times$day
# filter(set_times, start_time < as_datetime("2024-05-16 06:00:00"))
# filter(set_times, start_time < as_datetime("2024-05-16 18:00:00"))
set_times <- set_times |>
mutate(start_time = case_when(start_time > as_datetime("2024-05-16 06:00:00") ~ start_time + hours(12),
.default = start_time),
stop_time = case_when(stop_time > as_datetime("2024-05-16 06:00:00") ~ stop_time + hours(12),
.default = stop_time))
set_times <- set_times |>
mutate(start_time = case_when(start_time < as_datetime("2024-05-16 18:00:00") ~ start_time + days(1),
.default = start_time),
stop_time = case_when(stop_time < as_datetime("2024-05-16 18:00:00") ~ stop_time + days(1),
.default = stop_time)) |>
mutate(start_time_12hr = format(start_time, "%I:%M %p"),
stop_time_12hr = format(stop_time, "%I:%M %p")) |>
mutate(time_label_12hr = paste0(start_time_12hr, " - ", stop_time_12hr),
time_label_position = start_time + (difftime(stop_time, start_time) /2)) |>
arrange(start_time)
# set_times <- set_times |>
# mutate(start_time = case_when(start_time > as_datetime("2024-05-16 12:00:00") ~ start_time + hours(12),
# start_time < as_datetime("2024-05-16 12:00:00") ~ start_time + hours(12)),
# stop_time = case_when(stop_time > as_datetime("2024-05-16 12:00:00") ~ stop_time + hours(12),
# stop_time < as_datetime("2024-05-16 12:00:00") ~ stop_time + days(1))) |>
# mutate(start_time = format(start_time, "%Y-%m-%d %I:%M %p"),
# stop_time = format(stop_time, "%Y-%m-%d %I:%M %p")) |>
# arrange(start_time)
set_times <- set_times |>
mutate(artist = factor(artist, levels = rev(set_times$artist)))
# before_midnight <- set_times |>
# filter(start_time > as_datetime("2024-05-16 06:00:00")) |>
# mutate(start_time = start_time + hours(12)) |>
# arrange(day, start_time)
#
# after_midnight <- set_times |>
# filter(start_time < as_datetime("2024-05-16 06:00:00")) |>
# mutate(start_time = start_time + days(1)) |>
# arrange(day, start_time)
#
# set_times <- bind_rows(before_midnight, after_midnight) |>
# arrange(day, start_time)
# one plot for each person
# another plot where scores are added and rect is colored on continuous heatmap scale
joe <- filter(set_times, !is.na(schedule_joe))# |>
#select(-c(stage))
ggplot() +
geom_segment(data=set_times, aes(x = as_datetime("2024-05-16 19:00:00"), xend = as_datetime("2024-05-17 06:00:00"),
y= artist, yend = artist, color = artist), linewidth = 3) +
geom_segment(data=set_times, aes(x = start_time, xend = stop_time, y = artist), linewidth = 2) +
geom_label(data=set_times, aes(label=time_label_12hr, x=time_label_position, y = artist), size=3.5) +
geom_rect(data=joe, aes(xmin = start_time, xmax= stop_time, ymin = -Inf, ymax = Inf, fill = schedule_joe), alpha = 0.3) +
#geom_rect(data=kimiko, aes(xmin = start_time, xmax= stop_time, ymin = -Inf, ymax = Inf, fill = schedule_joe), alpha = 0.3) +
facet_grid(rows = vars(stage), scales = "free_y") +
scale_x_datetime(date_breaks = "1 hour", date_labels = "%I %M %p") +
scale_fill_manual(values = c("1" = gre, "2" = yel, "3" = gry)) +
#scale_color_manual(values = rep(my_cols,3)) +
jam_theme_bw +
#jam_theme_45 +
theme(legend.position = "none") +
ylab("") + xlab("")
joe <- filter(set_times, !is.na(schedule_joe))# |>
#select(-c(stage))
kimiko <- filter(set_times, !is.na(schedule_kimiko))# |>
#select(-c(stage))
sum_votes <- full_join(joe, kimiko) |>
mutate(schedule_joe = ifelse(is.na(schedule_joe), "0", schedule_joe),
schedule_kimiko = ifelse(is.na(schedule_kimiko), "0", schedule_kimiko)) |>
mutate(votes = as.numeric(schedule_joe) + as.numeric(schedule_kimiko))
ggplot() +
geom_segment(data=set_times, aes(x = as_datetime("2024-05-16 19:00:00"), xend = as_datetime("2024-05-17 06:00:00"),
y= artist, yend = artist, color = artist), linewidth = 3) +
geom_segment(data=set_times, aes(x = start_time, xend = stop_time, y = artist), linewidth = 2) +
geom_label(data=set_times, aes(label=time_label_12hr, x=time_label_position, y = artist), size=3.5) +
geom_rect(data=sum_votes, aes(xmin = start_time, xmax= stop_time, ymin = -Inf, ymax = Inf, fill = votes), alpha = 0.3) +
facet_grid(rows = vars(stage), scales = "free_y") +
scale_x_datetime(date_breaks = "1 hour", date_labels = "%I %M %p") +
scale_fill_gradient(low = red, high = yel) +
#scale_color_discrete(values = rep(my_cols,3)) +
jam_theme_bw +
#jam_theme_45 +
theme(legend.position = "none") +
ylab("") + xlab("")
```
## Run time
```{r}
Sys.time() - start_time
```
## Session
```{r}
sessionInfo()
```