-
Notifications
You must be signed in to change notification settings - Fork 0
/
class_data.R
9 lines (7 loc) · 2.49 KB
/
class_data.R
1
2
3
4
5
6
7
8
9
library(tidyverse)
x = c("Student\tEmail\tTotalAbsent", "Afzali, Behdad \[email protected] \t0.00%", NA, "Bell, Alexander \[email protected] \t0.00%", NA, "Ben-Omran, Munder \[email protected] \t0.00%", NA, "Bettedi, Lucia \[email protected] \t0.00%", NA, "Brown, Alan \[email protected] \t0.00%", NA, "Chen, Wenqian \[email protected] \t0.00%", NA, "Chisolm, Danielle \[email protected] \t0.00%", NA, "Chowdhury, Ashis \[email protected] \t0.00%", NA, "Clubb, Lauren \[email protected] \t0.00%", NA, "Drew, Jessi \[email protected] \t0.00%", NA, "Duncombe, Caroline \[email protected] \t0.00%", NA, "Duren, Michelle \[email protected] \t0.00%", NA, "Duyck, Marianne \[email protected] \t0.00%", NA, "Eghbali, Areian \[email protected] \t0.00%", NA, "El-hendawy, Ahmad \[email protected] \t0.00%", NA, "Fletcher, Colin \[email protected] \t0.00%", NA, "Futrega, Katarzyna \[email protected] \t1.00%", NA, "Gaikwad, Snehal \[email protected] \t0.00%", NA, "Giordano, Nicholas \[email protected] \t0.00%", NA, "Graham, Alice \[email protected] \t0.00%", NA, "Gupta, Neha \[email protected] \t0.00%", NA, "Guruswamy, Mahesh \[email protected] \t0.00%", NA, "he, yafeng \[email protected] \t0.00%", NA, "Jaeger, Catherine \[email protected] \t0.00%", NA, "Kieltyka, Jacqueline \[email protected] \t0.00%", NA, "Lee, Alex \[email protected] \t0.00%", NA, "Lehmann, Michael \[email protected] \t0.00%", NA, "Liu, Christine \[email protected] \t0.00%", NA, "Miao, Lingling \[email protected] \t0.00%", NA, "Morrison, Tasha \[email protected] \t0.00%", NA, "Nie, Zuqin \[email protected] \t0.00%", NA, "Noeker, Jacob \[email protected] \t0.00%", NA, "PAPAL, Samantha \[email protected] \t0.00%", NA, "Philips, Rachael \[email protected] \t0.00%", NA, "Ramirez-Valdez, Ramiro \[email protected] \t0.00%", NA, "Ringel, Julia \[email protected] \t0.00%", NA, "Roth, Jacob \[email protected] \t0.00%", NA, "SHILO, ASAF \[email protected] \t0.00%", NA, "Stamos, Daniel \[email protected] \t0.00%", NA, "Tello, Lawrence \[email protected] \t0.00%", NA, "Thakur, Anil \[email protected] \t0.00%", NA, "Vijjamarri, Anil Kumar \[email protected] \t0.00%")
bl <- str_split(x[!is.na(x)], '\\t')
class_data <- Reduce(rbind, bl) %>% as_tibble() %>%
set_names(.[1,]) %>% slice(-1) %>%
mutate_all(str_trim) %>%
select(-3)