-
Notifications
You must be signed in to change notification settings - Fork 0
/
2021-05-25-MarioKart64.Rmd
70 lines (62 loc) · 2.68 KB
/
2021-05-25-MarioKart64.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
59
60
61
62
63
64
65
66
67
68
69
---
title: '2021-05-25-MarioKart64'
author: "Kristen A, kkakey"
date: "5/26/2021"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
```{r}
library(tidyverse)
library(ggtext)
```
```{r}
records <- readr::read_csv('https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2021/2021-05-25/records.csv')
```
```{r}
df <- records %>%
filter(system_played=="PAL") %>%
group_by(date) %>%
slice_max(order_by = time, n=1) %>%
ungroup()
ggplot() +
geom_point(data=df %>% filter(type=="Single Lap"), aes(date, time, color=shortcut, shape=type)) +
geom_point(data=df %>% filter(type=="Three Lap"), aes(date, time, fill=shortcut, shape=type),color="black") +
facet_wrap(~track) +
scale_fill_manual(values=c('#43B047', '#0532fa')) +
scale_color_manual(values=c('#43B047', '#0532fa')) +
scale_shape_manual(values=c(8,22)) +
theme_linedraw() +
theme(legend.position = "none",
strip.text= element_text(family="Videophreak", size=12),
plot.title = element_text(family="Videophreak", hjust=.5, size=24),
plot.subtitle = element_markdown(family = "No-Continue", hjust=.5, size=15),
plot.background = element_rect(fill="#fc2500", color=NA),
axis.text = element_text(color="black", family="No-Continue"),
axis.title = element_text(family="Videophreak"),
axis.title.x = element_text(margin = margin(t = 10, r = 0, b = -15, l = 0)),
axis.title.y = element_text(margin = margin(t = 0, r = 10, b = 0, l = -15)),
panel.border = element_rect(size=5),
plot.margin = margin(t=1, r=.85, b=.5, l=.85, "cm"),
plot.caption = element_text(vjust=-7, family="No-Continue")) +
ylim(-5,max(df$time)+5) +
xlab("Date") + ylab("Time (seconds)") +
ggtitle("Mario Kart 64 PAL World Records") +
labs(subtitle = paste0("<span style = 'color:black'>World records for each original Mario Kart tracks by full three laps</span>",
# hacky way to add spaces
"<span style = 'color:#fc2500; font-size:5pt'>.............</span>",
"<span style = 'color:black'>, </span>",
"<span style = 'color:#43B047'>with </span>",
"<span style = 'color:black'>or </span>",
"<span style = 'color:#0532fa'>without </span>",
"<span style = 'color:black'>shortcuts, and single laps</span>",
# hacky way to add spaces
"<span style = 'color:#fc2500; font-size:5pt'>.............</span>",
"<span style = 'color:black'>over time</span>"),
caption = "Data: Mario Kart World Records | Created by: @kkakey") +
ggsave("plot-PAL.png", height=10, width=15)
```
Fonts
- [Videophreak](https://www.1001fonts.com/videophreak-font.html)
- [No Continue Regular](https://www.1001fonts.com/no-continue-font.html)