1 setwd("~/online_communities/coldcallbot/data/")
6 gs <- read.delim("student_information.tsv")
8 colnames(d) <- c("student.num", "unique.name")
10 call.list <- do.call("rbind", lapply(list.files(".", pattern="^call_list-.*tsv$"), function (x) {read.delim(x, stringsAsFactors=FALSE)[,1:4]}))
12 colnames(call.list) <- gsub("_", ".", colnames(call.list))
14 table(call.list$unique_name[call.list$answered])
16 ## drop calls where the person wasn't present
17 call.list.full <- call.list
18 call.list[!call.list$answered,]
19 call.list <- call.list[call.list$answered,]
21 call.counts <- data.frame(table(call.list$unique.name))
22 colnames(call.counts) <- c("unique.name", "num.calls")
24 d <- merge(d, call.counts, all.x=TRUE, all.y=TRUE, by="unique.name"); d