/
.Rhistory
512 lines (512 loc) · 20.8 KB
/
.Rhistory
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
ylab("% Respondents") +
scale_fill_discrete(name = "",
labels = c("Before Workshop", "After Workshop")) +
ggtitle("Respondents' Programming Usage Increased") +
theme(plot.title = element_text(hjust = 0.5)) +
theme_classic(base_size = 14)
# get some % change values to use in the text
delta_pre_have_not_been_using <-
pre_and_post_usage %>%
filter(grepl("have", value)) %>%
spread(key, value)
delta_pre_have_not_been_using <-
round(delta_pre_have_not_been_using$perc[2] -
delta_pre_have_not_been_using$perc[1], 1)
delta_pre_daily_using <-
pre_and_post_usage %>%
filter(grepl("Daily", value)) %>%
spread(key, value)
delta_pre_daily_using <-
round(delta_pre_daily_using$perc[2] -
delta_pre_daily_using$perc[1], 1)
pre_and_post_test <-
pre_and_post_usage %>%
select(-perc) %>%
spread(value, n) %>%
ungroup()
# chi-sq test
pre_and_post_test_result <-
chisq.test(pre_and_post_test[ , !names(pre_and_post_test) == 'key'])
# standardised residuals
stdres <- data.frame(t(pre_and_post_test_result$stdres))
names(stdres) <- pre_and_post_test$key
stdres$freq <- row.names(stdres)
# just show post-workshop
stdres <- stdres[, c(2,3)]
names(stdres) <- rev(c("Frequency", "Residual"))
# large positive residuals means there were more xxx than the hypothesis of independence predicts. Where are out large +ve residuals?
# Contribution in percentage (%)
# The contribution (in %) of a given cell to the total Chi-square score is calculated as follows:
contrib <- 100 * pre_and_post_test_result$residuals^2 / pre_and_post_test_result$statistic
# scale 0 to 1 to use as alpha
range0to1 <- function(x){(x-min(x))/(max(x)-min(x))}
# reorder to match order of programming factor
contrib_0_to_1 <- as.vector(range0to1(contrib))[c(3,5,9,7,11,1)]
# colour +ve and -ve values
# http://stackoverflow.com/a/12910865/1036500
stdres$sign = ifelse(stdres$Residual >= 0,
"positive",
"negative")
# get the categories in a sensible order
ggplot(stdres,
aes(factor(Frequency,
levels = programming),
Residual,
fill = sign)) +
geom_col(position = "dodge",
aes(alpha = contrib_0_to_1)) +
xlab("") +
ylab("Chi-square standardized residuals of\npost-workshop frequencies") +
scale_x_discrete(labels = function(x) lapply(strwrap(x, width = 10, simplify = FALSE), paste, collapse = "\n")) +
scale_fill_manual(name = "",
values = c("negative" = "red",
"positive" = "blue"),
labels = c("Fewer respondents than \nexpected assuming no effect",
"More respondents than \nexpected assuming no effect")) +
ggtitle("Workshops result in respondents \nprogramming significantly more often") +
theme(plot.title = element_text(hjust = 0.5)) +
theme_classic(base_size = 14) +
scale_alpha_continuous("Contribution to \nchi-square value") +
guides(fill=guide_legend(
keywidth = 0.1,
keyheight = 0.4,
default.unit = "inch")
)
#A chi-square test indicates that there is a significant difference in the frequencies of the pre- and post-workshop responses about #programming use. The chi-squared standardized residuals for the post-workshop values show that significantly more respondents do #programming daily after the workshop than expected if the workshop had no effect. Similarly, significantly fewer respondents program #less than once per year after the workshop.
# Jonah's fix to include the correct levels. Variable was renamed to 'levels' #because 'order' is the name of a function in R.
cols_with_Agree <- map_lgl(data, ~`%in%`("Agree", .x))
data_agree <- data[ , cols_with_Agree]
levels = c("Strongly Disagree", "Disagree", "Neutral", "Agree", "Strongly Agree")
# Beth's tip to both order the factors based on levels and unify the factors
factorfunction <- function(mydata, factlevel){
factor(mydata,
levels=factlevel,
ordered = TRUE)
fct_unify(mydata,
levels=factlevel)}
# End tip
data_agree_likert <- likert(data.frame(lapply(data_agree, factor, levels, ordered=TRUE)))
# Elizabeth's tip on factors
for(i in seq_along(data_agree)) {
data_agree[[i]] <- factor(data_agree[[i]], levels=order)}
print(levels(data_agree))
title <- "Workshops are Welcoming & Useful"
theme_update(plot.title = element_text(hjust = 0.5))
plot(data_agree_likert) + ggtitle(title)
print(class(data_agree))
data_agree <- map_if(data_agree,
is.character,
as.factor)
table(data$Activities)
table(data$Column53)
table(data$Column54)
table(data$Column55)
table(data$Column56)
table(data$Column57)
# Responses are in columns 'Behaviors-Adopted' through 'Column32'
# Use 'gather' to go from wide to long format
Behaviors <-
data %>%
select(`Behaviors.Adopted`:Column32) %>%
gather(col, Behaviors) %>%
group_by(Behaviors) %>%
tally() %>%
filter(!is.na(Behaviors)) %>%
arrange(desc(n))
# how many rate either of these?
#- data management and project organization practices : Behaviors-Adopted
#- used programming languages for automation : Column28
#- used version control to manage code : Column30
Behaviors_Adopted <- select(data, `Behaviors.Adopted`:Column32)
Behaviors_Adopted <- data.frame(apply(Behaviors_Adopted, 2, function(x) ifelse(x == "NA", 0, 1)))
relevant_cols <- c("Behaviors.Adopted", "Column28", "Column30")
Behaviors_Adopted <- Behaviors_Adopted[, names(Behaviors_Adopted) %in% relevant_cols]
number_that_adopted_any_of_those_three <- sum(ifelse(rowSums(Behaviors_Adopted, na.rm = TRUE) >= 1, 1, 0))
kable(Behaviors) # Use caption = "Behaviors Adopted by Respondents" to add a caption
confidence = c("I'm less confident now.", "I'm equally confident now.", "I'm more confident now.")
confidence = factor(confidence)
data$Change.In.Confidence = factor(data$Change.In.Confidence, levels = confidence)
data_change.in.confidence_tally <-
data %>%
group_by(Change.In.Confidence) %>%
tally() %>%
filter(!is.na(Change.In.Confidence))
# kable(data_confidence_tally)
ggplot(data_change.in.confidence_tally,
aes(Change.In.Confidence, y = 100 * (n/sum(n)),
n)) +
geom_bar(stat = "identity", fill = "orange") +
geom_text(aes(label=n), size= 4) +
scale_x_discrete(labels = function(x) lapply(strwrap(x, width = 10, simplify = FALSE), paste, collapse="\n")) +
theme_classic() +
xlab("Change in Confidence") +
ylab("% Respondents") +
ggtitle("Respondents are More Confident Post-Workshop") +
theme(plot.title = element_text(hjust = 0.5)) +
theme_bw(base_size = 14)
# Data are in columns 'How.Tools.Learned.Help' through 'Column37'
# Ben's tip to use 'gather' to go from wide to long format
# I want to present this data as a percentage as opposed to count. Tips?
# How many responded to either of these?
# They are improving my overall efficienct : How.Tools.Learned.Helped
# They are improving my ability to analyze data. : Column34
# They are improving my ability to manage data. : Column35
Tools_Learned <- select(data, `How.Tools.Learned.Help`:Column35)
Tools_Learned <- data.frame(apply(Tools_Learned, 2, function(x) ifelse(x == "NA", 0, 1)))
relevant_cols <- c("How.Tools.Learned.Help", "Column34", "Column35")
Tools_Learned <- Tools_Learned[, names(Tools_Learned) %in%
relevant_cols]
number_that_tools_helped <- sum(ifelse(rowSums(Tools_Learned, na.rm = TRUE) >= 1, 1, 0))
how_help <-
data %>%
select(`How.Tools.Learned.Help`:Column37) %>%
gather(col, how_help) %>%
group_by(how_help) %>%
tally() %>%
filter(!is.na(how_help)) %>%
arrange(desc(n)) %>%
rename(`How.Tools.Learned.Help` = how_help)
# Grab data to use in-line
not_helped <- how_help[how_help$How.Tools.Learned.Help == 'Column36', ]$n
not_using <- how_help[how_help$How.Tools.Learned.Help == 'Column37', ]$n
tools_helped <-
data %>%
select(`How.Tools.Learned.Help`:Column37) %>%
gather(col, tools_helped) %>%
group_by(tools_helped) %>%
tally() %>%
filter(!is.na(tools_helped)) %>%
arrange(desc(n)) %>%
rename(`How Tools Covered Have Helped` = tools_helped)
kable(tools_helped)
writing = c("No.", "Not sure.", "Yes.")
writing = factor(writing)
data$Contributed.To.Writing = factor(data$Contributed.To.Writing, levels = writing)
Contributed_Writing <- round(prop.table(table(data$Contributed.To.Writing)) * 100)
# data_writing_tally <-
# data %>%
# group_by(Contributed.To.Writing) %>%
# tally() %>%
# filter(!is.na(Contributed.To.Writing)) %>%
# arrange(desc(n))
kable(Contributed_Writing, format = "markdown", row.names = FALSE, col.names = c("Have the Tools Learned Contributed to Academic Writing?", "%"))
Learning_Activities <-
data %>%
select(Activities:Column57) %>%
gather(col, Learning_Activities) %>%
group_by(Learning_Activities) %>%
tally() %>%
filter(!is.na(Learning_Activities)) %>%
arrange(desc(n)) %>%
rename(`Learning Activities` = Learning_Activities)
self <- Learning_Activities %>% filter(`Learning Activities` == "Used self-guided Carpentry lesson material.") %>%
collect() %>%
.[["n"]]
# Data in columns 'Activities' through Column57
Continuous_Learning <-
data %>%
select(`Activities`:Column57) %>%
gather(col, Continuous_Learning) %>%
group_by(Continuous_Learning) %>%
tally() %>%
filter(!is.na(Continuous_Learning)) %>%
arrange(desc(n)) %>%
rename(`Continuous Learning Post-Workshop` = Continuous_Learning)
kable(Continuous_Learning, format = "markdown", row.names = FALSE, col.names = c("Continuous Learning", "n"))
#my.prop <- round(prop.table(n) * 100)
#kable(my.prop, format = "markdown", row.names = TRUE, col.names = c("%"))
#table(names,my.prop)
#How do I change the row names in the output table from 1, 2, 3, 4, 6, 6 to names
#<- c("Used non-Carpentry self-guided material.",
#"Used self-guided Carpentry lesson material.",
#"Participated in an in-person short course.",
#"Participated in an online short course.",
#"Participated in a Meetup.",
#"Participated in a semester long course.")?
# Data in columns 'Carpentry.Involvement through Column51
Carpentry_Involvement <-
data %>%
select(`Carpentry.Involvement`:Column51) %>%
gather(col, Carpentry_Involvement) %>%
group_by(Carpentry_Involvement) %>%
tally() %>%
filter(!is.na(Carpentry_Involvement)) %>%
arrange(desc(n)) %>%
rename(`Involvement Since Attending a Carpentry Workshop` = Carpentry_Involvement)
kable(Carpentry_Involvement) # Use caption = "How respondents became involved" to add caption
data_recommended_tally <-
data %>%
group_by(Recommended) %>%
tally() %>%
filter(!is.na(Recommended)) %>%
arrange(desc(n))
said_yes <- data_recommended_tally[data_recommended_tally$Recommended == "Yes.", ]$n
# kable(data_recommended_tally)
data_likelyrecommend_tally <-
data %>%
group_by(Likely.To.Recommend) %>%
tally() %>%
filter(!is.na(Likely.To.Recommend)) %>%
arrange(desc(n))
# kable(data_likelyrecommend_tally)
# Jonah's fix to include the correct levels. Variable was renamed to 'levels' #because 'order' is the name of a function in R.
cols_with_Agree <- map_lgl(data, ~`%in%`("Agree", .x))
data_agree <- data[ , cols_with_Agree]
levels = c("Strongly disagree", "Disagree", "Neutral", "Agree", "Strongly agree")
# Beth's tip to both order the factors based on levels and unify the factors
factorfunction <- function(mydata, factlevel){
factor(mydata,
levels=factlevel,
ordered = TRUE)
fct_unify(mydata,
levels=factlevel)}
# End tip
data_agree_likert <- likert(data.frame(lapply(data_agree, factor, levels, ordered=TRUE)))
# Elizabeth's tip on factors
for(i in seq_along(data_agree)) {
data_agree[[i]] <- factor(data_agree[[i]], levels=order)}
print(levels(data_agree))
title <- "Workshops are Welcoming & Useful"
theme_update(plot.title = element_text(hjust = 0.5))
plot(data_agree_likert) + ggtitle(title)
print(class(data_agree))
data_agree <- map_if(data_agree,
is.character,
as.factor)
# Jonah's fix to include the correct levels. Variable was renamed to 'levels' #because 'order' is the name of a function in R.
cols_with_Agree <- map_lgl(data, ~`%in%`("Agree", .x))
data_agree <- data[ , cols_with_Agree]
levels = c("Strongly disagree", "Disagree", "Neutral", "Agree", "Strongly agree")
# Beth's tip to both order the factors based on levels and unify the factors
factorfunction <- function(mydata, factlevel){
factor(mydata,
levels=factlevel,
ordered = TRUE)
fct_unify(mydata,
levels=factlevel)}
# End tip
data_agree_likert <- likert(data.frame(lapply(data_agree, factor, levels, ordered=TRUE)))
# Elizabeth's tip on factors
for(i in seq_along(data_agree)) {
data_agree[[i]] <- factor(data_agree[[i]], levels=order)}
print(levels(data_agree))
title <- "Workshops are Welcoming & Useful"
theme_update(plot.title = element_text(hjust = 0.5))
plot(data_agree_likert) + ggtitle(title)
#print(class(data_agree))
data_agree <- map_if(data_agree,
is.character,
as.factor)
# Jonah's fix to include the correct levels. Variable was renamed to 'levels' #because 'order' is the name of a function in R.
cols_with_Agree <- map_lgl(data, ~`%in%`("Agree", .x))
data_agree <- data[ , cols_with_Agree]
levels = c("Strongly disagree", "Disagree", "Neutral", "Agree", "Strongly agree")
# Beth's tip to both order the factors based on levels and unify the factors
factorfunction <- function(mydata, factlevel){
factor(mydata,
levels=factlevel,
ordered = TRUE)
fct_unify(mydata,
levels=factlevel)}
# End tip
data_agree_likert <- likert(data.frame(lapply(data_agree, factor, levels, ordered=TRUE)))
# Elizabeth's tip on factors
for(i in seq_along(data_agree)) {
data_agree[[i]] <- factor(data_agree[[i]], levels=order)}
#print(levels(data_agree))
title <- "Workshops are Welcoming & Useful"
theme_update(plot.title = element_text(hjust = 0.5))
plot(data_agree_likert) + ggtitle(title)
#print(class(data_agree))
data_agree <- map_if(data_agree,
is.character,
as.factor)
# Code chunk for Likert plot.
# How do we change the y axis labels?
cols_with_Agree <- map_lgl(data, ~`%in%`("Agree", .x))
data_agree <- data[ , cols_with_Agree]
levels = c("Strongly disagree", "Disagree", "Neutral", "Agree", "Strongly agree")
factorfunction <- function(mydata, factlevel){
factor(mydata,
levels=factlevel,
ordered = TRUE)
fct_unify(mydata,
levels=factlevel)}
data_agree_likert <- likert(data.frame(lapply(data_agree, factor, levels, ordered=TRUE)))
for(i in seq_along(data_agree)) {
data_agree[[i]] <- factor(data_agree[[i]], levels=order)}
title <- "Workshops Atmosphere & Content"
theme_update(plot.title = element_text(hjust = 0.5))
plot(data_agree_likert) + ggtitle(title)
data_agree <- map_if(data_agree,
is.character,
as.factor)
# Code chunk for Likert plot.
# How do we change the y axis labels?
cols_with_Agree <- map_lgl(data, ~`%in%`("Agree", .x))
data_agree <- data[ , cols_with_Agree]
levels = c("Strongly disagree", "Disagree", "Neutral", "Agree", "Strongly agree")
# factorfunction <- function(mydata, factlevel){
# factor(mydata,
# levels=factlevel,
# ordered = TRUE)
# fct_unify(mydata,
# levels=factlevel)}
data_agree_likert <- likert(data.frame(lapply(data_agree, factor, levels, ordered=TRUE)))
for(i in seq_along(data_agree)) {
data_agree[[i]] <- factor(data_agree[[i]], levels=order)}
title <- "Workshops Atmosphere & Content"
theme_update(plot.title = element_text(hjust = 0.5))
plot(data_agree_likert) + ggtitle(title)
data_agree <- map_if(data_agree,
is.character,
as.factor)
cols_with_Often <- map_lgl(data, ~`%in%`("Often", .x))
data_often <- data[ , cols_with_Often]
order = c("Never", "Rarely", "Sometimes", "Often", "All of the time")
print(class(data_often))
data_often <- map_if(data_often,
is.character,
as.factor)
for(i in seq_along(data_often)) {
data_often[[i]] <- factor(data_often[[i]], levels=order)
}
title <- "Respondent Perception of Instructors & Helpers"
data_often_likert <- likert(as.data.frame(data_often))
library(knitr)
opts_chunk$set(echo = FALSE,
message = FALSE,
warning = FALSE)
library(tidyr)
library(ggmap)
library(likert)
library(purrr)
library(mapproj)
library(ggplot2)
library(dplyr)
library(knitr)
library(RColorBrewer)
library(readr)
data <- read.csv("https://raw.githubusercontent.com/kariljordan/carpentry-community-assessment-projects/master/software-carpentry-projects/data-postworkshop.csv", na.strings = "")
# This code block provides a breakdown by gender.
# Are there better ways to represent this data? Go for it!
gender = c("Female", "Male", "Other", "Prefer not to say")
gender = factor (gender)
data$Gender = factor (data$Gender, levels = gender)
Gender <- round(prop.table(table(data$Gender)) * 100)
kable(Gender, format = "markdown", row.names = FALSE, col.names = c("Gender", "%"))
# Code chunk for Status of Respondents
# Only 3 status levels (undergrad, grad, faculty) are showing up on the plot.
# Ideas for how to fix this?
status = c("Undergraduate Student", "Graduate Student", "Post-Doctoral Researcher", "Faculty", "Research Staff (including research programmer)", "Support Staff (including technical support)", "Librarian/Archivist", "Commercial Software Developer", "Other")
status = factor(status)
data$Status = factor(data$Status, levels = status)
data_status_tally <-
data %>%
group_by(Status) %>%
tally() %>%
filter(!is.na(Status))
ggplot(data_status_tally,
aes(Status, y = 100 * (n/sum(n)),
n)) +
geom_bar(stat = "identity", fill="orange") +
geom_text(aes(label=n), size= 4) +
scale_x_discrete(labels = function(x) lapply(strwrap(x, width = 10, simplify = FALSE), paste, collapse="\n")) +
theme_classic() +
xlab("Status") +
ylab("% Respondents") +
ggtitle("Majority of Respondents were Graduate Students") +
theme(plot.title = element_text(hjust = 0.5)) +
theme_classic(base_size = 14)
# Code chunk to include data in markdown report
Status <- round(prop.table(table(data$Status)) * 100)
Status
# Code chunk for workshop pace.
# Are there better ways to represent this data? Go for it!
pace = c("Just right", "Slightly fast", "Slightly slow", "Too fast", "Too slow")
pace = factor (pace)
data$Pace = factor (data$Pace, levels = pace)
Pace <- round(prop.table(table(data$Pace)) * 100)
kable(Pace, format = "markdown", row.names = FALSE, col.names = c("Workshop Pace", "%"))
# Code chunk for balance of lecture to hands-on work.
# Are there better ways to represent this data? Go for it!
balance = c("Too much lecture", "Slightly too much lecture", "Balanced (lecture/hands-on)","Slightly too much hands-on", "Too much hands-on")
balance = factor (balance)
data$Balance = factor (data$Balance, levels = balance)
Balance <- round(prop.table(table(data$Balance)) * 100)
kable(Balance, format = "markdown", row.names = FALSE, col.names = c("Balance: Lecture to Hands-On Work", "%"))
# Code chunk for Likert plot.
# How do we change the y axis labels?
# The percentages on this plot are the exact same percentages from the long-term
# assessment survey likert plot. I copied and pasted the code thinking it would
# translate properly. Can someone find the bug?
cols_with_Agree <- map_lgl(data, ~`%in%`("Agree", .x))
data_agree <- data[ , cols_with_Agree]
levels = c("Strongly disagree", "Disagree", "Neutral", "Agree", "Strongly agree")
# factorfunction <- function(mydata, factlevel){
# factor(mydata,
# levels=factlevel,
# ordered = TRUE)
# fct_unify(mydata,
# levels=factlevel)}
data_agree_likert <- likert(data.frame(lapply(data_agree, factor, levels, ordered=TRUE)))
for(i in seq_along(data_agree)) {
data_agree[[i]] <- factor(data_agree[[i]], levels=order)}
title <- "Workshops Atmosphere & Content"
theme_update(plot.title = element_text(hjust = 0.5))
plot(data_agree_likert) + ggtitle(title)
data_agree <- map_if(data_agree,
is.character,
as.factor)
cols_with_Often <- map_lgl(data, ~`%in%`("Often", .x))
data_often <- data[ , cols_with_Often]
order = c("Never", "Rarely", "Sometimes", "Often", "All of the time")
print(class(data_often))
data_often <- map_if(data_often,
is.character,
as.factor)
for(i in seq_along(data_often)) {
data_often[[i]] <- factor(data_often[[i]], levels=order)
}
title <- "Respondent Perception of Instructors & Helpers"
data_often_likert <- likert(as.data.frame(data_often))
plot(data_often_likert) + ggtitle(title)
cols_with_Little <- map_lgl(data, ~`%in%`("Little or no knowledge of topic", .x))
data_little <- data[ , cols_with_Little]
order = c("Never", "Rarely", "Sometimes", "Often", "All of the time")
data_little <- map_if(data_little,
is.character,
as.factor)
for(i in seq_along(data_agree)) {
data_agree[[i]] <- factor(data_agree[[i]], levels=order)
}
title <- "Self-Reported Knowledge of Tools Covered"
data_little_likert <- likert(as.data.frame(data_little))
plot(data_little_likert) + ggtitle(title)
table(data$New.Information)
#Code chunk for likert plot (perception of workshop instructors/helpers)
cols_with_Often <- map_lgl(data, ~`%in%`("Often", .x))
data_often <- data[ , cols_with_Often]
order = c("Never", "Rarely", "Sometimes", "Often", "All of the time")
#print(class(data_often))
data_often <- map_if(data_often,
is.character,
as.factor)
for(i in seq_along(data_often)) {
data_often[[i]] <- factor(data_often[[i]], levels=order)
}
title <- "Respondent Perception of Instructors & Helpers"
data_often_likert <- likert(as.data.frame(data_often))
plot(data_often_likert) + ggtitle(title)
cols_with_Little <- map_lgl(data, ~`%in%`("Little or no knowledge of topic", .x))
data_little <- data[ , cols_with_Little]
order = c("Never", "Rarely", "Sometimes", "Often", "All of the time")
data_little <- map_if(data_little,
is.character,
as.factor)
for(i in seq_along(data_agree)) {
data_agree[[i]] <- factor(data_agree[[i]], levels=order)
}
title <- "Self-Reported Knowledge of Tools Covered"
data_little_likert <- likert(as.data.frame(data_little))
plot(data_little_likert) + ggtitle(title)