/
krieger_ll.Rmd
58 lines (45 loc) · 1.63 KB
/
krieger_ll.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
---
title: "Scheisse: Algernop Krieger Classics"
author: "Mara Averick"
output: html_notebook
editor_options:
chunk_output_type: inline
---
```{r load libs, message = FALSE}
library(tidyverse)
library(magick)
library(here)
library(magrittr)
library(ggthemes)
library(extrafont)
```
```{r krieger terms, message = FALSE}
krieger_ll_terms <- read_csv(here("data", "krieger_ll_terms.csv"))
```
Fill to match character colors from [*_Beyond the Tip: a data-driven exploration of Archer_*](https://archervisualization.herokuapp.com/) using the adjusted log likelihood values.
```{r krieger ll chart}
krieger_ll_terms %>%
mutate(term = reorder(term, adjLL)) %>%
ggplot(aes(term, adjLL)) +
geom_bar(stat = "identity", fill = "#966FD6") +
ggtitle("Krieger's Most Distinctive Terms") +
xlab(NULL) +
coord_flip() +
theme_tufte(base_family = "Arial", base_size = 13, ticks = FALSE) +
scale_y_continuous(expand = c(0,0)) +
theme(plot.title = element_text(size = 14, family = 'Baveuse-Regular'),
axis.text = element_text(size = 8, family = 'Consolas'),
axis.text.y = element_text(face = "bold"),
axis.title.x = element_blank())
ggsave(filename = here("img", "krieger_ll_plot.png"), width = 5, height = 4, dpi = 300)
```
```{r krieger coffe}
background <- image_read(here("img", "krieger_ll_plot.png"))
coffee_raw <- image_read(here("img", "krieger_coffee_no_bg.gif"))
frames <- lapply(coffee_raw, function(frame) {
image_composite(background, frame, offset = "+450+430")
})
animation <- image_animate(image_join(frames))
image_write(animation, here("img", "krieger_ll_coffee.gif"))
```
![](http://i.imgur.com/GoULPHJ.gif)