1 rates <- read.csv("../tables/all.csv")
\r
2 title = "Problem Solving, 2010, 2011"
\r
3 y1 <- rates$hours.problem.solve.2010
\r
4 y2 <- rates$hours.problem.solve.2011
\r
5 total.hours.2010 <- rates$hours.outbound.2010 + rates$hours.inbound.2010
\r
6 total.hours.2011 <- rates$hours.outbound.2010 + rates$hours.inbound.2011
\r
11 png(file="problem_solve_2010_2011.png",
\r
12 width=5, height=3.5, units="in", res=res)
\r
13 xlab.text="Week in Year"
\r
15 ylab = "hours in thousands"
\r
16 if (make.title == T ) top.margin = 3
\r
17 if (make.title != T ) title=""
\r
18 if (months.grid == T) bottom.margin = 6
\r
19 if (months.grid == T) xlab = ''
\r
20 margins=c(bottom.margin, 4, top.margin, 0.5)
\r
23 par('family'='serif')
\r
24 y_range = range(y1,y2, na.rm=T)
\r
25 plot(x, type='n', xlab=xlab, ylab=ylab, las=1, main=title,
\r
26 ylim=c(y_range), axes=F, xlim=c(range(x)))
\r
28 axis(2, col=ax_col, las=1, at=axTicks(2))
\r
30 rect(38, -10, 39, 300, col=rec_col, border=NA, xpd = F)
\r
31 abline( h=axTicks(2), lty=1, lwd=lwd_grid, col=ax_col)
\r
33 lines(x,y1, col=line_colors[1], type="l", lwd=lwd, lty=line_types[1])
\r
34 lines(x,y2, col=line_colors[2], type="l", lwd=lwd, lty=line_types[2])
\r
35 if(months.grid == T) mtext(side = 1, xlab.text, line=2)
\r
36 source("make_x_axis.R")
\r
37 legend("topleft", c("2010","2011"), cex=legend_font_size,
\r
38 col=line_colors, lty=line_types, bty='y', bg="white", box.lwd=box.lwd)
\r
41 title = "Problem Solving, 2010, 2011"
\r
42 y1 <- rates$hours.problem.solve.2010
\r
43 y2 <- rates$hours.problem.solve.2011
\r
44 total.hours.2010 <- rates$hours.outbound.2010 + rates$hours.inbound.2010
\r
45 total.hours.2011 <- rates$hours.outbound.2011 + rates$hours.inbound.2011
\r
46 y1 <- y1/total.hours.2010
\r
47 y2 <- y2/total.hours.2011
\r
50 #png(file="charts/problem_solve2_2010_2011.png",
\r
51 #width=5, height=3.5, units="in", res=res)
\r
52 #xlab.text="Week in Year"
\r
54 #ylab = "percentage to total"
\r
55 #if (make.title == T ) top.margin = 3
\r
56 #if (make.title != T ) title=""
\r
57 #if (months.grid == T) bottom.margin = 6
\r
58 #if (months.grid == T) xlab = ''
\r
59 #margins=c(bottom.margin, 4, top.margin, 0.5)
\r
62 #par('family'='serif')
\r
63 #y_range = range(y1,y2, na.rm=T)
\r
64 #plot(x, type='n', xlab=xlab, ylab=ylab, las=1, main=title,
\r
65 # ylim=c(y_range), axes=F, xlim=c(range(x)))
\r
66 #axis(1, col=ax_col)
\r
67 #axis(2, col=ax_col, las=1, at=axTicks(2))
\r
69 #rect(38, -10, 39, 300, col=rec_col, border=NA, xpd = F)
\r
70 #abline( h=axTicks(2), lty=1, lwd=lwd_grid, col=ax_col)
\r
72 #lines(x,y1, col=line_colors[1], type="l", lwd=lwd, lty=line_types[1])
\r
73 #lines(x,y2, col=line_colors[2], type="l", lwd=lwd, lty=line_types[2])
\r
74 #if(months.grid == T) mtext(side = 1, xlab.text, line=2)
\r
75 #if(months.grid == T) axis(1, at=at, labels=months, line=4,
\r
76 #cex.axis=months.font, lab=NULL)
\r
77 #legend("topleft", c("2010","2011"), cex=legend_font_size,
\r
78 # col=line_colors, lty=line_types, bty='y', bg="white", box.lwd=box.lwd)
\r
82 #mean.2010 <- mean(y1)
\r
83 #cat("mean for 2010 is", mean.2010, "\n")
\r
84 #cat("mean for pre cutover 2011 is", mean(y2[1:37]), "\n")
\r
85 #cat("mean for post cutover 2011 is", mean(y2[38:52]), "\n")
\r
86 #mean(t2) - mean(t1)
\r
91 #s = sum(total.hours.2011)
\r
92 #h = .015 * sum(total.hours.2011)
\r
98 #cat("difference of means between weeks 42-52, 2010, 2011", mean(t2) - mean(t1), "(t test below)\n")
\r
101 #cat("The hours extra are", .015 * s, "\n")
\r