Removed data files
[covid19.git] / euromomo / Output_IA_ET_v42.R
diff --git a/euromomo/Output_IA_ET_v42.R b/euromomo/Output_IA_ET_v42.R
deleted file mode 100644 (file)
index 64dbe0e..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-### Ambient temperatures ###\r
-ET <- read.table(file=paste0(indir,"/temperature.txt"), header = T, sep =";", dec=".")\r
-ET <- ET[with(ET, order(year, week)),]\r
-ET$t = ifelse((ET$week %% 2) == 0, min(ET$temp, ET$ptmin, na.rm = TRUE), max(ET$temp, ET$ptmax, na.rm = TRUE))\r
-ET$temp = ifelse(is.na(ET$temp), ET$ptemp, ET$temp)\r
-ET$Uexecc <- with(ET, pmax(ptmax,temp))\r
-ET$Lexecc <- with(ET, pmin(ptmin,temp))\r
-ET$wk <- 1:nrow(ET)\r
-ET$yw <- sprintf("%04iw%02d", ET$year, ET$week)\r
-\r
-png(paste0(outdir,"/temperature_v4R.png"), width=1200, height=800, res=130)\r
-par(mar=c(9,4,3,2))\r
-with(ET, {\r
-  plot(x=wk, y=t, type="n", xlab=NA, ylab="Degree Celsius", \r
-      main="Ambient temperatures", bty="l", xaxt="n")\r
-  axis(1, at=wk[as.integer(substr(yw,6,7)) %in% c(1,27)], \r
-      labels=yw[as.integer(substr(yw,6,7)) %in% c(1,27)], las=2, cex.axis=0.9)\r
-  polygon(x=c(wk,rev(wk)), y=c(Uexecc, rev(ptmax)),\r
-    border=do.call(rgb, c(as.list(col2rgb("red")/255), alpha=0.5)),\r
-    col=do.call(rgb, c(as.list(col2rgb("red")/255), alpha=0.5)))\r
-  polygon(x=c(wk,rev(wk)), y=c(Lexecc, rev(ptmin)),\r
-    border=do.call(rgb, c(as.list(col2rgb("blue")/255), alpha=0.5)),\r
-    col=do.call(rgb, c(as.list(col2rgb("blue")/255), alpha=0.5)))\r
-  points(x=wk, y=ptemp, type="l", col="black")\r
-  points(x=wk, y=ptmin, type="l", col="blue")\r
-  points(x=wk, y=ptmax, type="l", col="red")\r
-  points(x=wk, y=temp, pch=19, cex=0.7)\r
-  mtext("Year-week", side=1, line=4.5)\r
-  legend("bottom", c("expected temperature", "max expected temperature", "min expected temperature"),\r
-    lty="solid", col=c("black", "red", "blue"), lwd=2,\r
-    horiz=TRUE, inset=c(0,-0.39), xpd=NA, bty="n", cex=1)\r
-  legend("bottom", c("observed temperature", "extreme heat", "extreme cold"),\r
-    col=c("black", do.call(rgb, c(as.list(col2rgb("red")/255), alpha=0.5)), do.call(rgb, c(as.list(col2rgb("blue")/255), alpha=0.5))), pch=c(19,15,15),\r
-    horiz=TRUE, inset=c(0,-0.46), xpd=NA, bty="n", cex=1, pt.cex=c(1,2,2))  \r
-})\r
-dev.off()\r
-rm(ET)\r
-\r
-\r
-### Influenza Activity ###\r
-\r
-results4 <- read.table(\r
-    file = paste0(outdir, "/", country, "_output_v4", ifelse(IArest, "_IArestricted", ""), ".txt"), \r
-    header = TRUE, sep =";", dec=".") \r
-results4 <- results4[with(results4, order(agegrp, year, week)),]\r
-results4$wk <- unlist(lapply(table(results4$agegrp), seq))\r
-results4$agegrp.labels <- ordered(results4$agegrp, \r
-    labels = c("0-4 years", "5-14 years", "15-64 years", "Aged 65", "Total"))\r
-results4$yw <- sprintf("%04iw%02d", results4$year, results4$week)\r
-\r
-\r
-png(paste0(outdir,"/IA_agegroups_v4R.png"), width=1200, height=1600, res=130)\r
-par(mar=c(3,4,2,2), oma=c(5,2,2,0), mfrow=c(5,1))\r
-for (a in 0:4)\r
-  with(results4[(results4$agegrp==a),], {\r
-    plot(x=wk, y=IA, xaxt="n", ylab=NA, xlab=NA, type="n", bty="l", \r
-        main=unique(results4$agegrp.labels)[a+1])\r
-    if (a==4) {\r
-      axis(1, at=wk[as.integer(substr(yw,6,7)) %in% c(1,27)], \r
-          labels=yw[as.integer(substr(yw,6,7)) %in% c(1,27)], las=2, cex.axis=0.9)\r
-    }\r
-    grid(nx=NA, ny=NULL)\r
-    abline(v=wk[as.integer(substr(yw,6,7)) %in% c(1,27)], col="lightgray", lty="dotted")\r
-    points(x=wk, y=IA, col="red", lwd=2, type="l")\r
-  })\r
-mtext("Influenza Activity per week", side=2, outer=TRUE)\r
-mtext("Influenza Activity by age group", side=3, outer=TRUE, adj=0, cex=1.2)\r
-mtext("year-week", side=1, line=5)\r
-dev.off()\r
-\r
-\r
-for (a in 0:4) {\r
-  png(paste0(outdir,"/IA_agegroup_",a,"_v4R.png"), width=1200, height=800, res=130)\r
-  par(mar=c(6,4,4,2))\r
-    with(results4[(results4$agegrp==a),], {\r
-      plot(x=wk, y=IA, xaxt="n", ylab="Influenza Activity per week", xlab=NA, type="n", bty="l")\r
-      axis(1, at=wk[as.integer(substr(yw,6,7)) %in% c(1,27)], \r
-          labels=yw[as.integer(substr(yw,6,7)) %in% c(1,27)], las=2, cex.axis=0.9)\r
-      grid(nx=NA, ny=NULL)\r
-      abline(v=wk[as.integer(substr(yw,6,7)) %in% c(1,27)], col="lightgray", lty="dotted")\r
-      mtext(paste("Influenza Activity, age group:",unique(results4$agegrp.labels)[a+1]), \r
-          side=3, line=1, adj=0)\r
-      points(x=wk, y=IA, col="red", lwd=2, type="l")\r
-      mtext("year-week", side=1, line=4.5)\r
-    })\r
-  dev.off()\r
-}\r
-rm(a)
\ No newline at end of file