/
videos.Rmd
82 lines (73 loc) · 1.67 KB
/
videos.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
75
76
77
78
79
80
81
---
title: "Course videos"
output: github_document
editor_options:
chunk_output_type: console
---
```{r setup, include = FALSE}
library(tidyverse)
library(readxl)
library(tidytext)
knitr::opts_chunk$set(
fig.height = 6,
fig.asp = 0.618,
dpi = 300,
out.width = "90%"
)
```
```{r load-data, message = FALSE}
videos <- read_excel("videos.xlsx")
```
## Video lengths
```{r}
videos %>%
count(week)
```
```{r}
videos <- videos %>%
mutate(length = ((min * 60) + sec) / 60)
videos %>%
group_by(week) %>%
summarise(
total = sum(length),
average = mean(length),
.groups = "drop"
) %>%
pivot_longer(cols = -week,
names_to = "measure_type",
values_to = "length",
names_transform = list(measure_type = str_to_title)
) %>%
mutate(week = as.factor(week)) %>%
ggplot(aes(x = week, y = length, fill = week)) +
geom_col() +
guides(fill = FALSE) +
facet_wrap(~measure_type, ncol = 1, scales = "free_y") +
labs(
title = "Lengths of pre-recorded videos in IDS 2020",
x = "Week",
y = "Length (in minutes)",
caption = "All videos can be found at introds.org"
)
```
## Video content
```{r}
videos %>%
mutate(unit = fct_inorder(unit)) %>%
unnest_tokens(word, title) %>%
anti_join(get_stopwords()) %>%
group_by(unit) %>%
count(word, sort = TRUE) %>%
filter(n > 1) %>%
slice_head(n = 5) %>%
ggplot(aes(y = word, x = n, fill = unit)) +
geom_col() +
guides(fill = FALSE) +
facet_wrap(~unit, ncol = 3, scales = "free") +
labs(
title = "Titles of pre-recorded videos in IDS 2020",
y = NULL,
x = NULL,
caption = "All videos can be found at introds.org"
)
```