Removed data files
[covid19.git] / euromomo / Output_txt_v42.R
diff --git a/euromomo/Output_txt_v42.R b/euromomo/Output_txt_v42.R
deleted file mode 100644 (file)
index 86f2fe7..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-### ;-separated txt files ###\r
-\r
-if (IArest) { \r
-  results4 <- read.table(file=paste0(outdir,"/",country,"_output_v4_IArestricted.txt"), \r
-      header = TRUE, sep =";", dec=".")\r
-} else { \r
-  results4 <- read.table(file=paste0(outdir,"/",country,"_output_v4.txt"), \r
-      header = TRUE, sep =";", dec=".")\r
-}\r
-\r
-csvout <- function(x, s) {\r
-  y <- do.call("rbind", lapply(sort(unique(x[,s])), function(i) {\r
-    cbind(unique(x[,"agegrp"]), min(x[(x[,s]==i),"yw"]), max(x[(x[,s]==i),"yw"]), \r
-        round(tail(\r
-          x[(x[,s]==i), \r
-              c(paste0("cEdIA_",s), paste0("cEdIA_",s,"_95L"), paste0("cEdIA_",s,"_95U"), \r
-              paste0("cEdET_",s), paste0("cEdET_",s,"_95L"), paste0("cEdET_",s,"_95U"), \r
-              paste0("cexcess_",s), paste0("cuexcess_",s), "N")],\r
-          n=1)))\r
-    }))\r
-  colnames(y) <- c("AgeGroup", "Start", "End", "cIA", "cIA_95L", "cIA_95U", \r
-                    "cET", "cET_95L", "cET_95U", "cexcess", "cuexcess", "N")\r
-  return(y)\r
-}\r
-\r
-results4$yw <- sprintf("%04iw%02i",results4$year, results4$week)\r
-\r
-for (s in c("summer","winter","year")) {\r
-  out <- do.call("rbind", lapply(0:4, function(a) {\r
-    csvout(results4[(!is.na(results4[,s])) & (results4$agegrp==a),], s)\r
-  }))\r
-  out$AgeGroup <- factor(out$AgeGroup, levels = c(0,1,2,3,4), \r
-        labels = c("0-4 years","5-14 years","15-64 years","Aged 65","Total"))\r
-  write.table(out[,c("AgeGroup", "Start", "End", "cIA", "cIA_95L", "cIA_95U", \r
-              "cET", "cET_95L", "cET_95U", "cexcess", "cuexcess")], \r
-      file = paste0(outdir, "/", s, "_deaths_v4_IA", ifelse(IArest, "restricted", ""), ".txt" ), \r
-      row.names = FALSE, quote = FALSE, sep =";", dec=".", na="")\r
-  if (population) {\r
-    out[,c("cIA", "cIA_95L", "cIA_95U", "cET", "cET_95L", "cET_95U", "cexcess", "cuexcess")] <-\r
-      round(100000 * out[,c("cIA", "cIA_95L", "cIA_95U", "cET", "cET_95L", "cET_95U", "cexcess", "cuexcess")] / out[,"N"], 2)\r
-    colnames(out) <- c("AgeGroup", "Start", "End", "cmrIA", "cmrIA_95L", "cmrIA_95U", "cmrET", "cmrET_95L", "cmrET_95U", "cexcess", "cuexcess", "N")\r
-    write.table(out[,c("AgeGroup", "Start", "End", "cmrIA", "cmrIA_95L", "cmrIA_95U", \r
-              "cmrET", "cmrET_95L", "cmrET_95U", "cexcess", "cuexcess")],\r
-      file=paste0(outdir,"/",s,"_mr_v4_IA", ifelse(IArest, "restricted", ""), ".txt"), \r
-      row.names = FALSE, quote = FALSE, sep =";", dec=".")\r
-  }\r
-}\r
-\r
-rm(out, s, csvout, results4)\r