Commits

Giovanni Marco Dall'Olio committed cc713a4

PLOTS: improvements on readibility of labels and answers

Comments (0)

Files changed (2)

results/plots/feedback_charts.pdf

Binary file modified.

src/plot_evaluations.R

 feedback.overall.long$question <- factor(feedback.overall.long$variable)
 feedback.overall.long$question <- gsub("(\\w*\\.\\w*\\.\\w*\\.\\w*\\.\\w*\\.\\w*)\\.", "\\1\n", feedback.overall.long$question, perl=T)
 feedback.overall.long$question <- gsub("\\.", " ", feedback.overall.long$question, perl=T)
+# FIX: manually fixing some labels
+feedback.overall.long$question <- gsub("What did you think of the\\s*ratio of teaching versus scientific lectures\n", "What did you think of the ratio\nof teaching versus scientific lectures", feedback.overall.long$question, perl=T)
+feedback.overall.long$question <- gsub("In general.*\n.*\n.*", "In general what did you think\nabout the length of the course", feedback.overall.long$question, perl=T)
 # FIX: merging "Department bullettin" and "Internal Institute mail" answers together
 feedback.overall.long$answer <- factor(feedback.overall.long$value)
-feedback.overall.long$answer <- gsub("internal.*", "Institute\n/Department mailing list", feedback.overall.long$answer, perl=T)
-feedback.overall.long$answer <- gsub("^Department.*", "Institute\n/Department mailing list", feedback.overall.long$answer, perl=T)
+feedback.overall.long$answer <- gsub("internal.*", "Institute\n/Department\nmailing list", feedback.overall.long$answer, perl=T)
+feedback.overall.long$answer <- gsub("^Department.*", "Institute\n/Department\nmailing list", feedback.overall.long$answer, perl=T)
 feedback.overall.long$answer <- gsub("([\\w()']*\\s[\\w()']*)\\s", "\\1\n", feedback.overall.long$answer, perl=T)
 feedback.overall.long$answer <- gsub("\\.", " ", feedback.overall.long$answer, perl=T)
 ggplot(data=feedback.overall.long) + generic_questions_plot + opts(title=plot_title)
 feedback.quality.long <- feedback.quality.long[complete.cases(feedback.quality.long),]
 plot_labels = rev(c("Very good", "Good", "Average", "Poor", "Very poor"))
 feedback.quality.long$answer <- factor(feedback.quality.long$value, levels=plot_labels)
-qplot(answer, data=feedback.quality.long, fill=answer, main=plot_title) + barchart_plot
-ggplot(data=feedback.quality.long) + violin_plot + scale_y_continuous("answer", breaks=1:length(plot_labels), labels=plot_labels) + opts(title=plot_title)
+qplot(answer, data=feedback.quality.long, fill=answer, main=paste(plot_title, "(Bar charts)")) + barchart_plot
+ggplot(data=feedback.quality.long) + violin_plot + scale_y_continuous("answer", breaks=1:length(plot_labels), labels=plot_labels) + opts(title=paste(plot_title, "(Violin plots)"))
 ggplot(data=feedback.quality.long) + student_violin_plot + scale_y_continuous("answer", breaks=1:length(plot_labels), labels=plot_labels) + opts(title="Distribution of answers by student (Quality of Lectures and Talks)")
 #ggplot(data=feedback.quality.long) + violin_plot
 #dev.off()
 feedback.relevance.long$answer <- factor(feedback.relevance.long$answer, levels=plot_labels)
 # FIX: "I don't know" answers should not be included in the violin plots, or at least they should be colored differently. Otherwise, it seems that a "I don't know" answer is better or worst than the other answers. 
 feedback.relevance.long.noIdontknow = subset(feedback.relevance.long, answer != "I don't know")
-qplot(answer, data=feedback.relevance.long.noIdontknow, fill=answer, main=plot_title) + barchart_plot
-ggplot(data=feedback.relevance.long.noIdontknow) + violin_plot + scale_y_continuous("answer", breaks=1:length(plot_labels), labels=plot_labels) + opts(title=plot_title)
+qplot(answer, data=feedback.relevance.long.noIdontknow, fill=answer, main=paste(plot_title, "(Bar charts)")) + barchart_plot
+ggplot(data=feedback.relevance.long.noIdontknow) + violin_plot + scale_y_continuous("answer", breaks=1:length(plot_labels), labels=plot_labels) + opts(title=paste(plot_title, "(Violin plots)"))
 ggplot(data=feedback.relevance.long.noIdontknow) + student_violin_plot + scale_y_continuous("answer", breaks=1:length(plot_labels), labels=plot_labels) + opts(title="Distribution of answers by student (Relevancy of Lectures and Talks)")
 #dev.off()
 
 feedback.length.long <- feedback.length.long[complete.cases(feedback.length.long),]
 plot_labels = rev(c("Too long", "Just right", "Too short"))
 feedback.length.long$answer <- factor(feedback.length.long$value, levels=plot_labels)
-qplot(answer, data=feedback.length.long, fill=answer, main=plot_title) + barchart_plot
-ggplot(data=feedback.length.long) + violin_plot + scale_y_continuous("answer", breaks=1:length(plot_labels), labels=plot_labels) + opts(title=plot_title)
-ggplot(data=feedback.length.long) + student_violin_plot + scale_y_continuous("answer", breaks=1:length(plot_labels), labels=plot_labels) + opts(title="Distribution of answers by studend (Length of Lectures and Talks)")
+qplot(answer, data=feedback.length.long, fill=answer, main=paste(plot_title, "(Bar charts)")) + barchart_plot
+ggplot(data=feedback.length.long) + violin_plot + scale_y_continuous("answer", breaks=1:length(plot_labels), labels=plot_labels) + opts(title=paste(plot_title, "(Violin plots)"))
+ggplot(data=feedback.length.long) + student_violin_plot + scale_y_continuous("answer", breaks=1:length(plot_labels), labels=plot_labels) + opts(title="Distribution of answers by student (Length of Lectures and Talks)")
 #dev.off()
 
 dev.off()