1 path = 'receive_rate_adjusted_draft.png'
\r
2 rates <- read.csv("../tables/all.csv")
\r
4 direct.hours <- rates$direct.hours.receive.2011
\r
5 real.hours <- rates$hours.receive.2011
\r
7 late <- direct.hours[start:52]
\r
8 title='Rate Receive Adjust'
\r
9 adj1 <- .455 # from earlier this year
\r
10 adj2 <- .365 # from last year
\r
11 indirect.late.adj1 <- late * adj1
\r
12 indirect.late.adj2 <- late * adj2
\r
13 late.adj1 <- indirect.late.adj1 + late
\r
14 late.adj2 <- indirect.late.adj2 + late
\r
15 adj1.line <- c(real.hours[1:(start - 1)], late.adj1)
\r
16 adj2.line <- c(real.hours[1:(start - 1)], late.adj2)
\r
20 png(file=path, width=width,
\r
21 height=3.5, units="in", res=res)
\r
22 y_range <- range(y1, y2,y3, na.rm=T)
\r
23 xlab.text="week in year"
\r
25 ylab = "units/man hour"
\r
26 if (make.title == T ) top.margin = 3
\r
27 if (make.title != T ) title=""
\r
28 if (months.grid == T) bottom.margin = 6
\r
29 if (months.grid == T) xlab = ''
\r
30 units <- rates$units.receive.2011
\r
34 y_range <- range(y1,y2,y3)
\r
35 margins=c(bottom.margin, 4, top.margin, 0.5)
\r
37 par('family'='serif')
\r
38 plot(x, type='n', xlab=xlab, ylab=ylab, las=1, main=title, ylim=c(y_range), axes=F)
\r
40 axis(2, col=ax_col, las=1, at=axTicks(2))
\r
42 abline( h=axTicks(2), lty=1, lwd=lwd_grid, col=ax_col)
\r
43 lines(x,y3, type="l", col=line_colors[1], lwd=lwd, lty=line_types[1])
\r
44 #lines(x,y2, type="l", col=line_colors[2], lwd=lwd, lty=line_types[2])
\r
45 lines(x,y1, col=line_colors[2], type="l", lwd=lwd, lty=line_types[2])
\r
46 x.poly = c(x, rev(x))
\r
47 y.poly = c(y1, rev(y3))
\r
48 polygon(x.poly, y.poly, col="lightgray", border=NA)
\r
49 arrows(x0=10, x1=7, y0=150, y1=150, length=.1)
\r
50 text(x=10, y=150,pos=4, "migration")
\r
51 arrows(x0=30, x1=35, y0=80, y1=80, length=.1)
\r
52 text(x=30, y=80,pos=2, "cutover")
\r
53 legend("bottomleft", c("adjusted","real"), cex=legend_font_size,
\r
54 col=line_colors, lty=line_types, bty='y', bg="white", box.lwd=box.lwd)
\r
55 source("make_x_axis.R")
\r