-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathlectures.qmd
More file actions
65 lines (52 loc) · 1.83 KB
/
Copy pathlectures.qmd
File metadata and controls
65 lines (52 loc) · 1.83 KB
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
---
title: "Lectures"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
library(kableExtra)
library(gt)
```
```{r read_data, include=FALSE}
schedule <- read.csv("syllabus.csv")
schedule$topics[is.na(schedule$topics)] <- ""
schedule$topics <- strsplit(schedule$topics, ";")
schedule$video[is.na(schedule$video)] <- ""
schedule$video <- strsplit(schedule$video, ";")
schedule$video <- sapply(schedule$video, function(x) {
l <- length(x)
if(l>0)
{
paste0(paste0("[Video ", 1:l, "](", x, ")"),collapse="; ")
} else {
" "
}})
n_lectures <- nrow(schedule)
schedule$slides[is.na(schedule$slides)] <- ""
schedule$slides <- paste0("[", schedule$slides, "](lectures/", sprintf("%02d", schedule$session_nr), "/", schedule$slides, ".html)")
schedule$slides_pdf[is.na(schedule$slides_pdf)] <- ""
schedule$slides_pdf <- paste0("[", schedule$slides_pdf, "](lectures/", sprintf("%02d", schedule$session_nr), "/", schedule$slides_pdf, ".pdf)")
schedule$reading[is.na(schedule$reading)] <- ""
schedule$reading <- paste0("[", schedule$reading, "](book/", schedule$reading, ".html)")
schedule$lab_video[is.na(schedule$lab_video)] <- ""
schedule$lab_video <- strsplit(schedule$lab_video, ";")
schedule$lab_video <- sapply(schedule$lab_video, function(x) {
l <- length(x)
if(l>0)
{
paste0(paste0("[Video ", 1:l, "](", x, ")"),collapse="; ")
} else {
""
}})
columns_for_display <- c("date",
"title",
"topics",
"slides",
"slides_pdf",
"reading",
"video")
schedule_for_display <- schedule[,columns_for_display]
```
```{r generate_table, echo=FALSE, warning=FALSE}
gt::gt(data=schedule_for_display) %>% gt::fmt_markdown(columns = c(slides, slides_pdf, reading, video))
```