-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathlectures.Rmd
More file actions
68 lines (56 loc) · 1.81 KB
/
Copy pathlectures.Rmd
File metadata and controls
68 lines (56 loc) · 1.81 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
66
67
68
---
title: "Lectures"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
library(kableExtra)
```
```{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("[Video ", 1:l, "](", x, ")")
} else {
""
}}
)
schedule$slides[is.na(schedule$slides)] <- ""
schedule$slides <- paste0("[", schedule$slides, "](lectures/", schedule$slides, ".html)")
schedule$slides_pdf[is.na(schedule$slides_pdf)] <- ""
schedule$slides_pdf <- paste0("[", schedule$slides_pdf, "](lectures/", schedule$slides_pdf, ".pdf)")
schedule$reading[is.na(schedule$reading)] <- ""
schedule$reading <- paste0("[", schedule$reading, "](lectures/", 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("[Video ", 1:l, "](", x, ")")
} else {
""
}})
columns_for_display <- c("date",
"title",
"topics",
"slides",
"slides_pdf",
"video",
"reading")
schedule_for_display <- schedule[,columns_for_display]
```
```{r generate_table, echo=FALSE}
kable(schedule_for_display, format = "html", caption = " ", escape = FALSE) %>%
kable_styling(bootstrap_options = "striped",
full_width = F,
position = "left") %>%
column_spec(1, width = "8em") %>%
column_spec(2, width = "20em")
```