-
Notifications
You must be signed in to change notification settings - Fork 1
/
2-statham.Rmd
74 lines (43 loc) · 973 Bytes
/
2-statham.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
70
71
72
73
74
---
title: "Time to Statham Punch"
author: "Angela Zoss"
date: "9/25/2017"
output: github_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(error = TRUE)
```
## Setup your environment
```{r}
# Load required libraries
library(tidyverse)
```
## Load your data
```{r}
# data comes from http://time.to.stathampun.ch/
punch <- read_csv("data/time_to_statham_punch.csv")
names(punch) <- make.names(names(punch), unique=TRUE)
```
## Cut to the chase - Time to punch for each movie
```{r}
ggplot(punch) +
geom_col(aes(x=Title,y=total.time.in.minutes))
```
## Fix the axis labels
Hint: try coord_flip()
```{r}
ggplot(punch) +
geom_col(aes(x=Title,y=total.time.in.minutes))
```
## Advanced: Sort the bars
```{r}
ggplot(punch) +
geom_col(aes(x=Title,y=total.time.in.minutes))
```
## Do it yourself - How many films per year?
Hint: geom_bar will count things for you
```{r}
```
## Do it yourself - Try a different chart type
```{r}
```