### preliminaries obs2<-scan("European_corn_borer_2003.txt") MD<-c(31,28,31,30,31,30,31,31,30,31,30,31) sum(MD) FD<-c(1, 1+cumsum(MD)[-length(MD)]) MN<-month.name[1:12] ### solution obs3<-scan("CornBorer_1992.txt") x<-range(c(obs2,obs3)) ymax<-max(max(density(obs2)$y),max(density(obs3)$y)) plot(density(obs2),xlim=x,ylim=c(0,ymax),col="red") lines(density(obs3,bw=4),col="blue") legend_text=c("1992","2003") legend(140,0.043,legend_text,lty=1,lwd=2,col=c("blue","red")) text(xpd=NA,201.8,-0.00885, "and 0.4") text(180,0.047,"European cornborer phenology 11 years apart")