setwd('~/Personal/MovieNight')
# setwd('~/Projects/MovieNight')
library(tidyverse)
library(lubridate)
library(AfterSl1p)
# devtools::load_all('~/Work/Projects/aftersl1p')
theme_set(theme_bw())
cols = c('#878787','#FDDBC7','#B2182B')
ranklevs = c('I would NOT come to watch this film',
'I do not love this film but would still show up',
'I would REALLY LIKE to watch this film')
make_rank = function(x){
x = factor(x, levels = ranklevs)
x = as.numeric(x) -2
return(x)
}
The voting data are available as a .csv file here.
dat = read.csv('data/current_week.csv', stringsAsFactors = FALSE, header = FALSE)
datm = as.matrix(dat)
tdf = read.csv('data/current_movies.csv', row.names = 1, header = FALSE,
stringsAsFactors = FALSE)
titles = tdf[[1]]
titles
## [1] "Timestamp" "M23gan" "TheMoment" "HoneyDont"
## [5] "Mickey17" "NakedGun" "Y2K" "WakeUpDeadMan"
## [9] "KpopDemonHunt"
names(titles) = c(rownames(tdf))
titles
## Timestamp [M3gan 2.0 (2025, 2:00)]
## "Timestamp" "M23gan"
## [The Moment (2026, 1:43)] [Honey Don't (2025, 1:29)]
## "TheMoment" "HoneyDont"
## [Mickey 17 (2025, 2:17)] [The Naked Gun (2025, 1:25)]
## "Mickey17" "NakedGun"
## [Y2K (2024, 1:32)] [Wake Up Dead Man (2025, 2:26)]
## "Y2K" "WakeUpDeadMan"
## [KPop Demon Hunters (2025, 1:40)]
## "KpopDemonHunt"
datm[datm %in% names(titles)] = titles[datm[datm %in% names(titles)]]
datm
## V1
## [1,] "Timestamp"
## [2,] "2026/04/22 1:57:07 p.m. AST"
## [3,] "2026/04/25 4:49:35 p.m. AST"
## [4,] "2026/04/25 6:24:23 p.m. AST"
## [5,] "2026/04/25 8:47:26 p.m. AST"
## [6,] "2026/04/26 9:12:00 p.m. AST"
## [7,] "2026/04/26 10:42:12 p.m. AST"
## [8,] "2026/04/27 8:05:12 p.m. AST"
## [9,] "2026/04/27 8:23:22 p.m. AST"
## [10,] "2026/04/27 8:24:18 p.m. AST"
## [11,] "2026/04/27 9:40:24 p.m. AST"
## [12,] "2026/04/28 9:34:41 a.m. AST"
## V2
## [1,] "M23gan"
## [2,] "I would NOT come to watch this film"
## [3,] "I do not love this film but would still show up"
## [4,] "I do not love this film but would still show up"
## [5,] "I do not love this film but would still show up"
## [6,] "I would REALLY LIKE to watch this film"
## [7,] "I would REALLY LIKE to watch this film"
## [8,] "I would REALLY LIKE to watch this film"
## [9,] "I do not love this film but would still show up"
## [10,] "I would REALLY LIKE to watch this film"
## [11,] "I would NOT come to watch this film"
## [12,] "I would REALLY LIKE to watch this film"
## V3
## [1,] "TheMoment"
## [2,] "I would NOT come to watch this film"
## [3,] "I do not love this film but would still show up"
## [4,] "I do not love this film but would still show up"
## [5,] "I do not love this film but would still show up"
## [6,] "I do not love this film but would still show up"
## [7,] "I would NOT come to watch this film"
## [8,] "I do not love this film but would still show up"
## [9,] "I do not love this film but would still show up"
## [10,] "I would REALLY LIKE to watch this film"
## [11,] "I do not love this film but would still show up"
## [12,] "I do not love this film but would still show up"
## V4
## [1,] "HoneyDont"
## [2,] "I do not love this film but would still show up"
## [3,] "I do not love this film but would still show up"
## [4,] "I do not love this film but would still show up"
## [5,] "I do not love this film but would still show up"
## [6,] "I do not love this film but would still show up"
## [7,] "I would NOT come to watch this film"
## [8,] "I do not love this film but would still show up"
## [9,] "I would REALLY LIKE to watch this film"
## [10,] "I would REALLY LIKE to watch this film"
## [11,] "I would REALLY LIKE to watch this film"
## [12,] "I do not love this film but would still show up"
## V5
## [1,] "Mickey17"
## [2,] "I do not love this film but would still show up"
## [3,] "I would NOT come to watch this film"
## [4,] "I do not love this film but would still show up"
## [5,] "I do not love this film but would still show up"
## [6,] "I do not love this film but would still show up"
## [7,] "I would NOT come to watch this film"
## [8,] "I do not love this film but would still show up"
## [9,] "I would NOT come to watch this film"
## [10,] "I would REALLY LIKE to watch this film"
## [11,] "I would NOT come to watch this film"
## [12,] "I do not love this film but would still show up"
## V6
## [1,] "NakedGun"
## [2,] "I would NOT come to watch this film"
## [3,] "I would NOT come to watch this film"
## [4,] "I do not love this film but would still show up"
## [5,] "I do not love this film but would still show up"
## [6,] "I do not love this film but would still show up"
## [7,] "I would NOT come to watch this film"
## [8,] "I do not love this film but would still show up"
## [9,] "I would REALLY LIKE to watch this film"
## [10,] "I would REALLY LIKE to watch this film"
## [11,] "I would REALLY LIKE to watch this film"
## [12,] "I would REALLY LIKE to watch this film"
## V7
## [1,] "Y2K"
## [2,] "I do not love this film but would still show up"
## [3,] "I do not love this film but would still show up"
## [4,] "I do not love this film but would still show up"
## [5,] "I do not love this film but would still show up"
## [6,] "I do not love this film but would still show up"
## [7,] "I would NOT come to watch this film"
## [8,] "I do not love this film but would still show up"
## [9,] "I would REALLY LIKE to watch this film"
## [10,] "I would REALLY LIKE to watch this film"
## [11,] "I would REALLY LIKE to watch this film"
## [12,] "I do not love this film but would still show up"
## V8
## [1,] "WakeUpDeadMan"
## [2,] "I would REALLY LIKE to watch this film"
## [3,] "I would REALLY LIKE to watch this film"
## [4,] "I would REALLY LIKE to watch this film"
## [5,] "I do not love this film but would still show up"
## [6,] "I would REALLY LIKE to watch this film"
## [7,] "I do not love this film but would still show up"
## [8,] "I do not love this film but would still show up"
## [9,] "I would NOT come to watch this film"
## [10,] "I would REALLY LIKE to watch this film"
## [11,] "I do not love this film but would still show up"
## [12,] "I would REALLY LIKE to watch this film"
## V9
## [1,] "KpopDemonHunt"
## [2,] "I would REALLY LIKE to watch this film"
## [3,] "I do not love this film but would still show up"
## [4,] "I do not love this film but would still show up"
## [5,] "I do not love this film but would still show up"
## [6,] "I would REALLY LIKE to watch this film"
## [7,] "I do not love this film but would still show up"
## [8,] "I do not love this film but would still show up"
## [9,] "I would NOT come to watch this film"
## [10,] "I would REALLY LIKE to watch this film"
## [11,] "I would NOT come to watch this film"
## [12,] "I do not love this film but would still show up"
# rev_titles = gsub(' [','',names(titles), fixed = TRUE)
# rev_titles = gsub(']','',rev_titles, fixed = TRUE)
# names(rev_titles) = titles
# colnames(datm) = rev_titles[colnames(datm)]
colnames(datm) = datm[1,]
datm = datm[-1,]
dat = (datm
%>% data.frame()
%>% mutate(Timestamp = substr(Timestamp, 1, 18),
Timestamp = ymd_hms(Timestamp)))
dat_num = (dat
%>% select(-Timestamp)
%>% mutate_all(make_rank))
results = sort(colSums(dat_num), decreasing = TRUE)
res_df = data.frame(results)
# rownames(res_df) = rev_titles[rownames(res_df)]
res_df
## results
## WakeUpDeadMan 5
## M23gan 3
## HoneyDont 2
## Y2K 2
## NakedGun 1
## KpopDemonHunt 1
## TheMoment -1
## Mickey17 -3
Wake Up Dead Man wins with 5 points!
brk_levs = c('I would NOT come\nto watch this film',
'I do not love this film\nbut would still show up',
'I would REALLY LIKE\nto watch this film')
dat_long = (dat
%>% gather(Movies, Votes, -Timestamp)
%>% mutate(Votes = factor(Votes, levels = ranklevs,
labels = brk_levs),
Movies = factor(Movies, levels = names(results))))
#levels(dat_long$Movies) = rev_titles[levels(dat_long$Movies)]
plt = ggplot(dat_long, aes(x = Movies, fill = Votes)) +
geom_bar(stat = 'count') +
scale_fill_manual(values = cols, name = 'Vote Value') +
ylab('Vote Count') +
rotate_ticks() +
theme(legend.text = element_text(margin = margin(t = 0.5,
b = 0.5,
unit = 'lines')))
png(filename = 'results/current_week.png', height = 480, width = 800)
plt +
theme(axis.title = element_text(size = 20),
axis.text.y = element_text(size = 15),
axis.text.x = element_text(size = 15,
angle = 90,
hjust = 1,
vjust = 0.5),
legend.text = element_text(size = 15, margin = margin(t = 0.5,
b = 0.5,
unit = 'lines')),
legend.title = element_text(size = 20))
#legend.key = element_rect(colour = 'white', size = 10))
dev.off()
## png
## 2
You can download a .png of the plot here.