Errata code
rm(list=ls())
X = read.csv("errata-dates.txt",
colClasses=c("character","numeric","factor","factor"))
X$date <- as.Date(X$date,format="%d-%m-%Y")
X = X[order(X$date),]
n <- 1:nrow(X)
begin <- as.Date("2008-04-01")
today <- as.Date(Sys.time())
attach(X)
## can't figure out xlim for Dates
png("errata.png")
par(las=1,bty="l")
plot(c(begin,date,today),c(0,n,n[length(n)]),
type="s",ylab="Cumulative errors found",axes=FALSE)
axis(side=2)
sdate <- seq.Date(begin,today,by="3 months")
axis.Date(side=1,at=sdate,labels=paste("\n",
gsub("-","\n",format(sdate,"%b-%Y"))))
points(date,n,col=type,pch=16)
ntype <- length(levels(type))
legend("topleft",
levels(type),
col=1:ntype,
pch=16)
text(date,n,page,adj=c(-0.2,1.2),xpd=NA)
detach(X)
others <- subset(cbind(X,n),who!="Ben Bolker")
cwho <- as.character(others$who)
cwho[1] <- gsub(" ","\n",cwho[1])
with(others,text(date,n,cwho,pos=2,cex=0.5,xpd=NA))
abline(v=as.Date("2009-09-01"),lty=2)
text(as.Date("2009-09-01"),20,"second\nprinting",pos=4)
dev.off()
page_revision: 3, last_edited: 1256333881|%e %b %Y, %H:%M %Z (%O ago)





