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" "M32gan" "MartySupreme" "HoneyDon't"
## [5] "Mikey17" "DeathofAUnicorn" "Babygirl" "WakeUpDeadMan"
## [9] "KPopDemonHunters"
names(titles) = c(rownames(tdf))
titles
## Timestamp [M3gan 2.0 (2025, 2:00)]
## "Timestamp" "M32gan"
## [Marty Supreme (2025, 2:30)] [Honey Don't (2025, 1:29)]
## "MartySupreme" "HoneyDon't"
## [Mickey 17 (2025, 2:17)] [Death Of A Unicorn (2025, 1:47)]
## "Mikey17" "DeathofAUnicorn"
## [Babygirl (2024, 155)] [Wake Up Dead Man (2025, 2:26)]
## "Babygirl" "WakeUpDeadMan"
## [KPop Demon Hunters (2025, 1:40)]
## "KPopDemonHunters"
datm[datm %in% names(titles)] = titles[datm[datm %in% names(titles)]]
datm
## V1
## [1,] "Timestamp"
## [2,] "2026/03/17 7:20:56 p.m. AST"
## [3,] "2026/03/17 7:39:08 p.m. AST"
## [4,] "2026/03/17 7:51:39 p.m. AST"
## [5,] "2026/03/17 9:32:20 p.m. AST"
## [6,] "2026/03/18 10:45:19 a.m. AST"
## [7,] "2026/03/18 3:13:30 p.m. AST"
## [8,] "2026/03/19 4:30:48 p.m. AST"
## [9,] "2026/03/19 4:32:12 p.m. AST"
## [10,] "2026/03/19 5:12:54 p.m. AST"
## [11,] "2026/03/20 11:52:38 a.m. AST"
## V2
## [1,] "M32gan"
## [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 would NOT come to watch this film"
## [7,] "I would NOT come 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 NOT come to watch this film"
## [11,] "I would NOT come to watch this film"
## V3
## [1,] "MartySupreme"
## [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 would NOT come to watch this film"
## [6,] "I would NOT come to watch this film"
## [7,] "I do not love this film but would still show up"
## [8,] "I would NOT come to watch this film"
## [9,] "I would NOT come to watch this film"
## [10,] "I would NOT come to watch this film"
## [11,] "I would NOT come to watch this film"
## V4
## [1,] "HoneyDon't"
## [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 would REALLY LIKE to watch this film"
## [6,] "I would NOT come 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 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"
## V5
## [1,] "Mikey17"
## [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 would REALLY LIKE to watch this film"
## [6,] "I would NOT come to watch this film"
## [7,] "I would REALLY LIKE 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 do not love this film but would still show up"
## [11,] "I would NOT come to watch this film"
## V6
## [1,] "DeathofAUnicorn"
## [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 would REALLY LIKE to watch this film"
## [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 REALLY LIKE to watch this film"
## V7
## [1,] "Babygirl"
## [2,] "I would NOT come to watch this film"
## [3,] "I would REALLY LIKE to watch this film"
## [4,] "I do not love this film but would still show up"
## [5,] "I would NOT come to watch this film"
## [6,] "I would NOT come 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"
## V8
## [1,] "WakeUpDeadMan"
## [2,] "I would REALLY LIKE to watch this film"
## [3,] "I would REALLY LIKE to watch this film"
## [4,] "I do not love this film but would still show up"
## [5,] "I would NOT come to watch this film"
## [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 would NOT come to watch this film"
## [10,] "I would NOT come to watch this film"
## [11,] "I would REALLY LIKE to watch this film"
## V9
## [1,] "KPopDemonHunters"
## [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 would NOT come 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 do not love this film but would still show up"
## [11,] "I would NOT come to watch this film"
# 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
## DeathofAUnicorn 3
## WakeUpDeadMan 3
## HoneyDon.t 0
## KPopDemonHunters 0
## Mikey17 -2
## M32gan -3
## Babygirl -3
## MartySupreme -6
Death of a Unicorn and Wake Up Dead Man tied with 3 points each! We will be watching Death of a Unicorn.
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.