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" "ViolentNight" "SilentNight" "AnnaApoca"
## [5] "NewportXmas" "BetterWatchOut" "Krampus" "JBHeist"
## [9] "Spirited"
names(titles) = c(rownames(tdf))
titles
## Timestamp [Violent Night (2022, 1:52)]
## "Timestamp" "ViolentNight"
## [Silent Night (2023, 1:44)] [Anna and the Apocalypse (2017, 1:48)]
## "SilentNight" "AnnaApoca"
## [Newport Christmas (2025, 1:24)] [Better Watch Out (2016, 1:29)]
## "NewportXmas" "BetterWatchOut"
## [Krampus (2015, 1:38)] [Jingle Bell Heist (2025, 1:36)]
## "Krampus" "JBHeist"
## [Spirited (2022, 2:07)]
## "Spirited"
datm[datm %in% names(titles)] = titles[datm[datm %in% names(titles)]]
datm
## V1
## [1,] "Timestamp"
## [2,] "2025/12/04 10:48:11 p.m. EST"
## [3,] "2025/12/05 12:08:25 a.m. EST"
## [4,] "2025/12/05 7:04:44 a.m. EST"
## [5,] "2025/12/05 7:55:53 a.m. EST"
## [6,] "2025/12/05 9:49:34 a.m. EST"
## [7,] "2025/12/07 8:11:45 p.m. EST"
## [8,] "2025/12/08 10:19:49 a.m. EST"
## [9,] "2025/12/08 5:45:01 p.m. EST"
## [10,] "2025/12/08 10:48:07 p.m. EST"
## [11,] "2025/12/08 11:26:38 p.m. EST"
## V2
## [1,] "ViolentNight"
## [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 REALLY LIKE to watch this film"
## [6,] "I do not love this film but would still show up"
## [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 do not love this film but would still show up"
## V3
## [1,] "SilentNight"
## [2,] "I would NOT come to watch this film"
## [3,] "I would NOT come to watch this film"
## [4,] "I would REALLY LIKE to watch this film"
## [5,] "I would NOT come to watch this film"
## [6,] "I do not love this film but would still show up"
## [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 do not love this film but would still show up"
## V4
## [1,] "AnnaApoca"
## [2,] "I would NOT come 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 do not love this film but would still show up"
## [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 do not love this film but would still show up"
## V5
## [1,] "NewportXmas"
## [2,] "I would REALLY LIKE 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 would NOT come 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 would NOT come to watch this film"
## [11,] "I do not love this film but would still show up"
## V6
## [1,] "BetterWatchOut"
## [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 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 NOT come to watch this film"
## [11,] "I do not love this film but would still show up"
## V7
## [1,] "Krampus"
## [2,] "I would NOT come to watch this film"
## [3,] "I do not love this film but would still show up"
## [4,] "I would REALLY LIKE to watch this film"
## [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 do not love this film but would still show up"
## [11,] "I do not love this film but would still show up"
## V8
## [1,] "JBHeist"
## [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 do not love this film but would still show up"
## [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 NOT come to watch this film"
## [11,] "I do not love this film but would still show up"
## V9
## [1,] "Spirited"
## [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 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 NOT come to watch this film"
## [11,] "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
## ViolentNight 2
## AnnaApoca 2
## JBHeist 0
## SilentNight -1
## NewportXmas -1
## Krampus -1
## Spirited -1
## BetterWatchOut -3
Anna and the Apocalypse tied with Violent Night with 2 points each!
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.