# 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" "Amsterdam" "WildCard" "ShapeOfWater"
## [5] "Bikeriders" "TheCurrentWar" "MidnightSpecial" "Minecraft"
## [9] "Oceans8"
names(titles) = c(rownames(tdf))
titles
## Timestamp [Amsterdam (2022, 2:15)]
## "Timestamp" "Amsterdam"
## [Wild Card (2015, 1:32)] [The Shape of Water (2017, 2:03)]
## "WildCard" "ShapeOfWater"
## [The Bikeriders (2023,1:56)] [The Current War (2017, 1:48)]
## "Bikeriders" "TheCurrentWar"
## [Midnight Special (2016, 1:52)] [A Minecraft Movie (2025, 1:41)]
## "MidnightSpecial" "Minecraft"
## [Oceans Eight (2018, 1:50)]
## "Oceans8"
datm[datm %in% names(titles)] = titles[datm[datm %in% names(titles)]]
datm
## V1
## [1,] "Timestamp"
## [2,] "2025/09/04 8:48:41 p.m. AST"
## [3,] "2025/09/04 11:19:54 p.m. AST"
## [4,] "2025/09/04 11:43:25 p.m. AST"
## [5,] "2025/09/05 12:45:07 p.m. AST"
## [6,] "2025/09/05 1:13:11 p.m. AST"
## [7,] "2025/09/08 4:56:55 p.m. AST"
## [8,] "2025/09/08 5:02:20 p.m. AST"
## [9,] "2025/09/08 6:56:56 p.m. AST"
## [10,] "2025/09/08 8:14:39 p.m. AST"
## [11,] "2025/09/08 8:18:34 p.m. AST"
## [12,] "2025/09/08 8:21:16 p.m. AST"
## V2
## [1,] "Amsterdam"
## [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 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 NOT come 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"
## V3
## [1,] "WildCard"
## [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 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 do not love this film but would still show up"
## [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,] "ShapeOfWater"
## [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 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 REALLY LIKE to watch this film"
## [12,] "I do not love this film but would still show up"
## V5
## [1,] "Bikeriders"
## [2,] "I do not love this film but would still show up"
## [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 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 do not love this film but would still show up"
## [11,] "I would NOT come to watch this film"
## [12,] "I do not love this film but would still show up"
## V6
## [1,] "TheCurrentWar"
## [2,] "I do not love this film but would still show up"
## [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 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 do not love this film but would still show up"
## [11,] "I would NOT come to watch this film"
## [12,] "I do not love this film but would still show up"
## V7
## [1,] "MidnightSpecial"
## [2,] "I do not love this film but would still show up"
## [3,] "I would REALLY LIKE to watch this film"
## [4,] "I would NOT come to watch this film"
## [5,] "I would REALLY LIKE to watch this film"
## [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 do not love this film but would still show up"
## [11,] "I would REALLY LIKE to watch this film"
## [12,] "I do not love this film but would still show up"
## V8
## [1,] "Minecraft"
## [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 would REALLY LIKE to watch this film"
## [6,] "I do not love this film but would still show up"
## [7,] "I would REALLY LIKE 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 do not love this film but would still show up"
## [11,] "I do not love this film but would still show up"
## [12,] "I do not love this film but would still show up"
## V9
## [1,] "Oceans8"
## [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 would REALLY LIKE 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 NOT come 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"
# 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
## Oceans8 3
## ShapeOfWater 1
## MidnightSpecial 1
## Minecraft 1
## WildCard -1
## Bikeriders -1
## TheCurrentWar -2
## Amsterdam -5
Ocean’s Eight wins with 3 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()
## quartz_off_screen
## 2
You can download a .png of the plot here.