#Load simulated outbreak data.
url <- paste("http://www.stat.uni-muenchen.de/~hoehle/",
"teaching/moid2011/tutorials/cast-backnow/outbreak.txt",sep="")
D <- try(read.table(url,header=TRUE,colClasses=c("integer",rep("Date",3))))
if (!inherits(D, "try-error")) {
#Convert line list to an sts object
sts <- linelist2sts(D, dateCol="dOnset", aggregate.by="1 day")
#Plot the result
plot(sts,xaxis.tickFreq=list("%d"=atChange,"%m"=atChange),
xaxis.labelFreq=list("%d"=at2ndChange),
xaxis.labelFormat="%d %b",legend.opts=NULL,
xlab="",las=2,cex.axis=0.8)
}
Run the code above in your browser using DataLab