3 # system("parse_rt_data.py 3 > rt_data.csv");
4 t <- read.csv('rt_data_2004-2010.csv', sep=',', header=TRUE)
5 t2 <- t[which(t$complete == 1),]
8 open_tickets <- function (t, from, to, type, fmt="%b")
10 # find 'type' range of days
11 dates <-seq(as.Date(from), as.Date(to), type)
12 months <- format(dates, fmt)
13 hbreaks<-unclass(as.POSIXct(dates))
18 for ( i in seq(1,length(hbreaks)-1) )
21 t_sub <- t[which(t$start > hbreaks[i] & t$lastreply <= hbreaks[i+1]),]
22 tickets <- length(t_sub$start)
23 #if ( nrow(t_sub) > 0 ){
24 # for ( j in seq(1,nrow(t_sub)) )
26 # #print(sprintf("id %s, date %s", t_sub[i,'ticket_id'], t_sub[i,'s1']))
27 # print(sprintf("id %s, date %s", t_sub[j,]$ticket_id, t_sub[j, 's1']))
31 xx<- c(xx, hbreaks[i])
35 m<- months[1:length(months)-1]
36 return (rbind(xx,yy,m))
39 ot <- open_tickets(t2, '2004/1/1', '2010/2/28', 'week', "%b%y")
41 plot(ot[1,], ot[2,], axes=F)
47 axis(1, labels=ot[3,], at=ot[1,])
50 ot <- open_tickets(t2, '2004/1/1', '2010/2/28', 'day', "%b%y")
51 x1<-as.numeric(ot[1,])
52 y1<-as.numeric(ot[2,])
61 lines(x1, y1, axes=F, pch='.')
62 axis(1, labels=ot[3,], at=ot[1,])
64 #lines(ot[1,], ot[2,])
65 #a<-smooth(as.numeric(y1))
69 a<-lowess(x1, y1, delta=(60*60*24), f=0.03)
76 lines(x, y, col='red')
77 lines(x, round(y), col='blue')
78 #lines(x, ceiling(y), col='blue')
80 abline_at_date('2005-01-01', 'grey40')
81 abline_at_date('2006-01-01', 'grey40')
82 abline_at_date('2007-01-01', 'grey40')
83 abline_at_date('2008-01-01', 'grey40')
84 abline_at_date('2009-01-01', 'grey40')
85 abline_at_date('2010-01-01', 'grey40')