From da93d3fd56f78a67c1f109f4c72f3fcf35fbc102 Mon Sep 17 00:00:00 2001 From: Benjamin Mako Hill Date: Mon, 7 Oct 2024 20:54:49 -0700 Subject: [PATCH] updated assessment code for new class - fix a few bugs related to make scripts work with no students have been fully missing - other smaller code fixes, path updates, etc --- assessment_and_tracking/track_participation.R | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/assessment_and_tracking/track_participation.R b/assessment_and_tracking/track_participation.R index 37898e7..8b9f368 100644 --- a/assessment_and_tracking/track_participation.R +++ b/assessment_and_tracking/track_participation.R @@ -1,4 +1,4 @@ -setwd("~/online_communities/coldcallbot/data/") +setwd("~/online_communities/coldcall_scripts-COM481-2024Q4/data/") library(data.table) @@ -6,9 +6,11 @@ library(data.table) ## LOAD call_list TSV data ################################################ -call.list <- do.call("rbind", lapply(list.files(".", pattern="^call_list-.*tsv$"), function (x) {read.delim(x, stringsAsFactors=FALSE)[,1:4]})) +call.list <- do.call("rbind", lapply(list.files(".", pattern="^call_list-.*tsv$"), function (x) {read.delim(x, stringsAsFactors=FALSE)[,1:5]})) colnames(call.list) <- gsub("_", ".", colnames(call.list)) +colnames(call.list)[1] <- "unique.name" +colnames(call.list)[2] <- "preferred.name" table(call.list$unique.name[call.list$answered]) @@ -29,7 +31,7 @@ absence.data.cols <- c("unique.name", "date.absent", "reported") missing.in.class <- call.list.full[!call.list.full$answered, c("unique.name", "timestamp")] missing.in.class$date.absent <- as.Date(missing.in.class$timestamp) -missing.in.class$reported <- FALSE +missing.in.class$reported <- rep(FALSE, nrow(missing.in.class)) missing.in.class <- missing.in.class[,absence.data.cols] missing.in.class <- unique(missing.in.class) @@ -37,7 +39,7 @@ missing.in.class <- unique(missing.in.class) ## LOAD absence data TSV data ################################################ -absence.google <- read.delim("absence_poll_data.tsv") +absence.google <- read.delim("optout_poll_data.tsv") colnames(absence.google) <- c("timestamp", "unique.name", "date.absent") absence.google$date.absent <- as.Date(absence.google$date.absent, format="%m/%d/%Y") absence.google$reported <- TRUE -- 2.39.5