3 gs <- read.delim("student_information.tsv")
5 colnames(d) <- c("student.num", "discord.name")
7 call.list <- do.call("rbind", lapply(list.files(".", pattern="^call_list-.*tsv$"), function (x) {read.delim(x)}))
8 colnames(call.list) <- gsub("_", ".", colnames(call.list))
10 call.counts <- data.frame(table(call.list$discord.name))
11 colnames(call.counts) <- c("discord.name", "num.calls")
13 d <- merge(d, call.counts, all.x=TRUE, all.y=TRUE, by="discord.name"); d
15 ## set anything that's missing to zero
16 d$num.calls[is.na(d$num.calls)] <- 0
18 attendance <- unlist(lapply(list.files(".", pattern="^attendance-.*tsv$"), function (x) {d <- read.delim(x); strsplit(d[[2]], ",")}))
20 attendance.counts <- data.frame(table(attendance))
21 colnames(attendance.counts) <- c("discord.name", "num.present")
23 d <- merge(d, attendance.counts, all.x=TRUE, all.y=TRUE, by="discord.name"); d