-
Notifications
You must be signed in to change notification settings - Fork 9
/
comp_labs.Rmd
175 lines (147 loc) · 6.28 KB
/
comp_labs.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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
---
title: "Computer Labs"
output: html_document
---
```{r child = "_timeline.Rmd", include=FALSE}
```
```{r child = "_list_of_labs.Rmd", include=FALSE}
```
<br>
### Meeting days & times
Thursday from 11:20-12:20 FISH 213
<br>
### Resources
* [FISH 550 lab book](https://atsa-es.github.io/atsa-labs/) & [atsa-es package repository](https://atsa-es.r-universe.dev/packages)
* [GitHub repo for assignments](https://github.com/atsa-es/fish550-2023) & [Team Lab Write-ups](https://atsa-es.github.io/fish550-2023/)
* [Discusssion board](https://github.com/atsa-es/fish550-2023/discussions)
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
```{r include=FALSE}
library(kableExtra)
```
```{r week_labs, include = FALSE}
week_labs <- list(d1 = matrixlab,
d2 = lmlab,
# d3 = "",
d4 = arimalab,
# d5 = "",
d6 = sslab2,
# d7 = "",
d8 = dfalab,
# d9 = "",
d10 = hmmlab,
# d11 = "",
d12 = bayeslab,
# d13 = "",
d14 = dlmlab,
# d15 = "",
d16 = spatiallab,
# d17 = "",
d18 = helplab,
# d19 = "",
d20 = presentlab
)
```
```{r topics, include = FALSE}
lab_topics <- lapply(week_labs, function(x){if(is.list(x)){x$topics}else{""}})
## topics formatted for html
lab_topics_html <- sapply(lapply(lab_topics, paste, "<br>", collapse=""), c)
names(lab_topics_html) <- NULL
```
<!-- first is PDF, 2nd PPT, 3rd Rmd -->
```{r lec_links, include = FALSE}
# lab_links <- lapply(week_labs, function(x){if(is.list(x)){c(x$pdf, x$rmd)}else{""}})
# ## topics formatted for html
# lab_links_html <- sapply(lapply(lab_links, function(x){ tmp1<-c("[PDF](","[Rmd]("); tmp2 <- c(")",")"); tmp1[x==""]=""; tmp2[x==""]=""; tmp <- paste(tmp1,x,tmp2); tmp=paste(tmp,collapse="<br>"); tmp}), c)
# names(lab_links_html) <- NULL
lab_links1 <- lapply(week_labs, function(x){if(is.list(x)){c(x$rmd)}else{""}})
lab_links1_html <- sapply(lapply(lab_links1, function(x){
tmp1<-paste0("[Rmd ",1:length(x),"]("); tmp2 <- ")"; tmp <- paste(tmp1,x,tmp2); tmp[x==""]=""; tmp=paste(tmp, collapse=" "); tmp}), c)
lab_links2 <- lapply(week_labs, function(x){if(is.list(x)){c(x$pdf)}else{""}})
lab_links2_html <- sapply(lapply(lab_links2, function(x){
tmp1<-paste0("[PDF ",1:length(x),"]("); tmp2 <- ")"; tmp <- paste(tmp1,x,tmp2); tmp[x==""]=""; tmp=paste(tmp, collapse=" "); tmp}), c)
lab_links3 <- lapply(week_labs, function(x){if(is.list(x)){c(x$html)}else{""}})
lab_links3_html <- sapply(lapply(lab_links3, function(x){
tmp1<-paste0("[html ",1:length(x),"]("); tmp2 <- ")"; tmp <- paste(tmp1,x,tmp2); tmp[x==""]=""; tmp=paste(tmp, collapse=" "); tmp}), c)
lab_links_html <- lab_links3_html
for(i in 1:length(lab_links3_html)){
lab_links_html[i] <- paste( lab_links3_html[i], lab_links2_html[i], lab_links1_html[i], sep="<br>")
}
names(lab_links_html) <- NULL
```
```{r video_links, include = FALSE}
vid_links <- lapply(week_labs, function(x){if(is.list(x)){x$video}else{""}})
## topics formatted for html
vid_links_html <- sapply(lapply(vid_links, function(x){
tmp1<-"[Video]("; tmp2 <- ")"; tmp <- paste(tmp1,x,tmp2); tmp[x==""]=""; tmp=paste(tmp,collapse="<br>"); tmp}), c)
names(vid_links_html) <- NULL
```
```{r repo_links, include = FALSE}
repo_links <- lapply(week_labs, function(x){if(is.list(x)){x$repo}else{""}})
## topics formatted for html
repo_links_html <- sapply(lapply(repo_links, function(x){
tmp1<-"[Repo folder]("; tmp2 <- ")"; tmp <- paste(tmp1,x,tmp2); tmp[x==""]=""; tmp=paste(tmp,collapse="<br>"); tmp}), c)
names(repo_links_html) <- NULL
```
```{r youtube_links, include = FALSE}
youtube_links <- lapply(week_labs, function(x){
if(is.list(x)){x$youtube}else{""}})
## topics formatted for html
youtube_links_html <- sapply(lapply(youtube_links, function(x){ tmp1<-"[YouTube]("; tmp2 <- ")"; tmp <- paste(tmp1,x,tmp2); tmp[x==""]=""; tmp=paste(tmp,collapse="<br>"); tmp}), c)
names(youtube_links_html) <- NULL
```
```{r data_links, include = FALSE}
data_links <- lapply(week_labs, function(x){if(is.list(x)){x$data}else{""}})
data_links_html <- sapply(lapply(data_links, paste, "<br>", collapse=""), c)
names(data_links_html) <- NULL
```
```{r homework, include = FALSE}
hw_links <- lapply(week_labs, function(x){if(is.list(x)){x$homework}else{""}})
## topics formatted for html
hw_links_html <- sapply(lapply(hw_links, paste, "<br>", collapse=""), c)
names(hw_links_html) <- NULL
```
```{r duedate, include = FALSE}
duedate_links <- lapply(week_labs, function(x){if(is.list(x)){x$hw_duedate}else{""}})
## topics formatted for html
dd_links_html <- sapply(lapply(duedate_links, paste, "<br>", collapse=""), c)
names(dd_links_html) <- NULL
```
```{r key_links, include = FALSE}
key_links <- lapply(week_labs, function(x){if(is.list(x)){c(x$key)}else{""}})
key_links_html <- sapply(lapply(key_links, function(x){
if(length(x)>1){
tmp1<-paste0("[Key ",1:length(x),"](") }else{ tmp1<-"[Key](" }; tmp2 <- ")"; tmp <- paste(tmp1,x,tmp2); tmp[x==""]=""; tmp=paste(tmp, collapse=" "); tmp}), c)
names(key_links_html) <- NULL
```
```{r instructors, include = FALSE}
instructors <- lapply(week_labs, function(x){if(is.list(x)){x$instructor}else{""}})
## topics formatted for html
instructor_html <- sapply(lapply(instructors, paste, "<br>", collapse=""), c)
names(instructor_html) <- NULL
```
```{r generate_table, echo=FALSE}
## data frame with dates & topics
syl_txt <- data.frame(
date = qtr[c(1, seq(2, 20, 2))],
instructor = instructor_html,
lab_topics = lab_topics_html,
lab_links = lab_links_html,
data_links = data_links_html,
repo_links = repo_links_html,
hw_links = hw_links_html,
duedate_links = dd_links_html
#key_links = key_links_html,
)
colnames(syl_txt) <- c("Date", "Instructor", "Topics", "Lab Material",
"Data", "Repo", "Assignment", "Due Date")
## generate table
kable(syl_txt, format = "html", caption = " ",
align = "cclccccc", escape = FALSE) %>%
kable_styling(bootstrap_options = "striped",
full_width = F,
position = "left") %>%
column_spec(1, width = "8em") %>%
scroll_box(height = "700px", extra_css = "border-style: none;")
```