-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRPhocPrep.R
18 lines (15 loc) · 906 Bytes
/
RPhocPrep.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#Import csv's first (manually)
inc <- Xdaily_incidence_total
gen <- Xgeneration_total
library(reshape2)
library(ggplot2)
library(plyr)
#incDay <- reshape(inc, idvar=c("Network", "Run"), timevar="Day", direction="wide")
incDay <- dcast(inc, Network + Run ~ Day, value.var="Incidence")
#genSize <- reshape(gen[,c("Network", "Run", "Generation", "Size")], idvar=c("Network", "Run"), timevar="Generation", direction="wide")
genSize <- dcast(gen[,c("Network", "Run", "Generation", "Size")], Network + Run ~ Generation, value.var="Size")
#genRatio <- reshape(gen[,c("Network", "Run", "Generation", "Ratio")], idvar=c("Network", "Run"), timevar="Generation", direction="wide")
genRatio <- dcast(gen[,c("Network", "Run", "Generation", "Ratio")], Network + Run ~ Generation, value.var="Ratio")
write.csv(incDay,"XincDay.csv")
write.csv(genSize,"XgenSize.csv")
write.csv(genRatio,"XgenRatio.csv")