@@ -5,7 +5,17 @@ file <- list.files(path="R_code/name_tags/", pattern = "report-", full.names = T
55
66dat <- read_csv(file [length(file )]) %> %
77 janitor :: clean_names() %> %
8- select(first_name , last_name , ticket_type , preferred_pronouns ) %> %
8+ # fill in name from purchaser if not provided for attendee
9+ mutate(first_name = ifelse(first_name == " Info Requested" , buyer_first_name ,
10+ first_name ),
11+ last_name = ifelse(first_name == " Info Requested" , buyer_last_name ,
12+ last_name )) %> %
13+ # fill with blank if only 1 name is missing
14+ mutate(first_name = ifelse(first_name == " Info Requested" , " " ,
15+ first_name ),
16+ last_name = ifelse(last_name == " Info Requested" , " " ,
17+ last_name )) %> %
18+ distinct(first_name , last_name , ticket_type , preferred_pronouns ) %> %
919 # Harmonize pronoun format
1020 mutate(preferred_pronouns = tolower(preferred_pronouns ),
1121 preferred_pronouns = gsub(" " ," /" , preferred_pronouns ),
@@ -18,6 +28,7 @@ dat <- read_csv(file[length(file)]) %>%
1828 preferred_pronouns = gsub(" his" ," him" ,preferred_pronouns ),
1929 preferred_pronouns = gsub(" hers" ," her" ,preferred_pronouns ),
2030 preferred_pronouns = gsub(" him/him" ," him" ,preferred_pronouns ),
31+ preferred_pronouns = gsub(" her/her" ," her" ,preferred_pronouns ),
2132 preferred_pronouns = ifelse(is.na(preferred_pronouns ) | preferred_pronouns == " yes" ," " ,
2233 preferred_pronouns )) %> %
2334 # Fix name formatting
@@ -42,43 +53,87 @@ dat <- read_csv(file[length(file)]) %>%
4253 line6 = " :::" ) %> %
4354 arrange(last_name ,first_name ) %> %
4455 rownames_to_column() %> %
45- mutate(ticket_group = case_when(grepl(" workshop" , ticket_type )~ " workshop" ,
46- grepl(" 6/20" , ticket_type )~ " workshop" ,
47- grepl(" Virtual|virtual" ,ticket_type )~ " virtual" ,
48- grepl(" Speaker" ,ticket_type )~ " speaker" ,
49- grepl(" Committee|Organizer" , ticket_type )~ " committee" ,
50- TRUE ~ " regular" )) %> %
51- distinct(ticket_group , ticket_type , line1 , line2 , line3 , line4 , line6 )
56+ # combo workshop and conf label
57+ mutate(group = ifelse(grepl(" 6/20" ,ticket_type ), " workshop" ," conf" )) %> %
58+ group_by(line2 ,line3 ) %> %
59+ mutate(types = length(unique(group ))) %> %
60+ ungroup() %> %
61+ # Rename ticket types
62+ mutate(ticket_group = case_when(
63+ grepl(" Speaker" ,ticket_type )~ " speaker" ,
64+ grepl(" Committee|Organizer" , ticket_type )~ " committee" ,
65+ types > 1 ~ " combo" ,
66+ grepl(" 6/20" , ticket_type )~ " workshop" ,
67+ grepl(" Virtual|virtual" ,ticket_type )~ " virtual" ,
68+ TRUE ~ " regular" )) %> %
69+ distinct(ticket_group , line1 , line2 , line3 , line4 , line6 ) %> %
70+ # Fix committee errors
71+ mutate(ticket_group = case_when(
72+ line2 == " [Cameron]{slot='name'}" &
73+ line3 == " [Mulder]{slot='title'}" ~ " committee" ,
74+ TRUE ~ ticket_group ))
5275# unique(dat$line2)
5376
5477# # Conference
5578dat %> %
5679 filter(ticket_group %in% c(" regular" ," speaker" )) %> %
57- mutate(line5 = ifelse(ticket_group == " speaker" ," [Speaker]{slot='url'}" , " " )) %> %
58- select(line1 : line4 ,line5 ,line6 ) %> %
80+ # Fix speaker errors
81+ mutate(ticket_group = case_when(
82+ line2 == " [Ted]{slot='name'}" & line3 == " [Laderas]{slot='title'}" ~ " speaker" ,
83+ line2 == " [Evan]{slot='name'}" & line3 == " [Landman]{slot='title'}" ~ " speaker" ,
84+ TRUE ~ ticket_group
85+ )) %> %
86+ mutate(line5 = case_when(ticket_group == " speaker" ~ " [Speaker]{slot='url'}" ,
87+ ticket_group == " regular" ~ " [Conference]{slot='url'}" ,
88+ TRUE ~ " " )) %> %
89+ select(ticket_group , line1 : line4 ,line5 ,line6 ) %> %
5990 rownames_to_column() %> %
60- pivot_longer(- rowname ) %> %
61- arrange(as.numeric(rowname ), name ) %> %
62- select(- rowname ) %> %
91+ pivot_longer(- c(rowname ,ticket_group )) %> %
92+ mutate(ticket_group = factor (ticket_group ,levels = c(" speaker" ," regular" ))) %> %
93+ arrange(ticket_group , as.numeric(rowname ), name ) %> %
94+ select(- rowname , - ticket_group ) %> %
6395 filter(value != " " ) %> %
6496 write_csv(file = " R_code/name_tags/data_conf.csv" , col_names = FALSE )
6597
6698# # Workshop
6799dat %> %
68100 filter(ticket_group == " workshop" ) %> %
69- select( line1 : line5 ) %> %
70- mutate( line4 = " [Workshop]{slot='url'} " ) %> %
101+ mutate( line5 = " [Workshop]{slot='url'} " ) %> %
102+ select( line1 : line4 , line5 , line6 ) %> %
71103 rownames_to_column() %> %
72104 pivot_longer(- rowname ) %> %
73105 arrange(as.numeric(rowname ), name ) %> %
74106 select(- rowname ) %> %
75107 write_csv(file = " R_code/name_tags/data_workshop.csv" , col_names = FALSE )
76108
109+ # # Combo
110+ dat %> %
111+ filter(ticket_group == " combo" ) %> %
112+ mutate(ticket_group = case_when(
113+ line2 == " [Yan]{slot='name'}" & line3 == " [Liu]{slot='title'}" ~ " speaker" ,
114+ line2 == " [Mauro]{slot='name'}" & line3 == " [Lepore]{slot='title'}" ~ " speaker" ,
115+ line2 == " [Megan]{slot='name'}" & line3 == " [Holtorf]{slot='title'}" ~ " speaker" ,
116+ line2 == " [Lindsay]{slot='name'}" & line3 == " [Dickey]{slot='title'}" ~ " speaker" ,
117+ line2 == " [Hanna]{slot='name'}" & line3 == " [Winter]{slot='title'}" ~ " speaker" ,
118+ line2 == " [Arilene]{slot='name'}" & line3 == " [Novak]{slot='title'}" ~ " speaker" ,
119+ line2 == " [Andie]{slot='name'}" & line3 == " [Hendrick]{slot='title'}" ~ " speaker" ,
120+ TRUE ~ ticket_group
121+ )) %> %
122+ mutate(line5 = case_when(
123+ ticket_group == " combo" ~ " [Workshop & Conference]{slot='url'}" ,
124+ ticket_group == " speaker" ~ " [Speaker]{slot='url'}" )) %> %
125+ select(line1 : line4 ,line5 ,line6 ) %> %
126+ rownames_to_column() %> %
127+ pivot_longer(- rowname ) %> %
128+ arrange(as.numeric(rowname ), name ) %> %
129+ select(- rowname ) %> %
130+ write_csv(file = " R_code/name_tags/data_combo.csv" , col_names = FALSE )
131+
77132# # Organizer
78133dat %> %
79134 filter(ticket_group == " committee" ) %> %
80- select(line1 : line6 ) %> %
81135 mutate(line5 = " [Organizer]{slot='url'}" ) %> %
136+ select(line1 : line4 ,line5 ,line6 ) %> %
82137 rownames_to_column() %> %
83138 pivot_longer(- rowname ) %> %
84139 arrange(as.numeric(rowname ), name ) %> %
0 commit comments