From: Don Armstrong Date: Tue, 8 Aug 2017 16:34:55 +0000 (-0700) Subject: calculate bugs per day and plot it X-Git-Url: https://git.donarmstrong.com/?p=debbugs-presentations.git;a=commitdiff_plain;h=70dab88e29a60687ce589a8832f82865e59c37b5 calculate bugs per day and plot it --- diff --git a/debbugs.Rnw b/debbugs.Rnw index 41d7014..e53a79c 100644 --- a/debbugs.Rnw +++ b/debbugs.Rnw @@ -147,10 +147,16 @@ scientific_10 <- function(x) { bug.growth <- fread("data/sorted_bug_growth_for_r_every_500.txt") colnames(bug.growth) <- c("time","bugs") bug.growth <- bug.growth[pmax(bugs) <= as.numeric(bugs),] +bug.growth <- bug.growth[order(time),] +bug.growth <- + bug.growth[c(0,diff(bugs))>=0,] bug.growth[,date:= as.POSIXct(ISOdatetime(1970,1,1,0,0,0)+ as.numeric(bug.growth$time))] -print(ggplot(bug.growth[date > as.POSIXct(ISOdatetime(2005,1,1,0,0,0)),], +bug.growth[,`bugs per day`:=c(0,diff(bugs)/ + as.double(diff(date),"days")) + ] +print(ggplot(bug.growth,#[date > as.POSIXct(ISOdatetime(2005,1,1,0,0,0)),], aes(x=date,y=bugs))+ xlab("Time")+ylab("Bugs filed in Debian")+ scale_y_continuous(labels = scientific_10)+ @@ -159,7 +165,20 @@ print(ggplot(bug.growth[date > as.POSIXct(ISOdatetime(2005,1,1,0,0,0)),], \end{center} \end{frame} -\begin{frame} +\begin{frame}{Bug Growth Rate} +<>= +print(ggplot(bug.growth[date > as.POSIXct(ISOdatetime(2014,1,1,0,0,0)),], + aes(x=date,y=`bugs per day`))+ + xlab("Time")+ylab("Bugs filed per day") + + scale_y_log10(breaks=c(60,100,200,400,800)) + + geom_line()+stat_smooth(method="lm") + + geom_label(data=data.table(date=as.POSIXct(ISOdatetime(2015,04,25,0,0,0)),"bugs per day"=400),label="Jessie",color="red") + + geom_label(data=data.table(date=as.POSIXct(ISOdatetime(2017,06,17,0,0,0)),"bugs per day"=400),label="Stretch",color="purple") + ) +@ +\end{frame} + +\begin{frame}{My entries into Cristian's game} \begin{columns} \column{0.5\textwidth} \begin{center}