Commit 40cb1d0c authored by de Freitas Costa, Eduardo's avatar de Freitas Costa, Eduardo
Browse files

New version

parent c2e16fd7
......@@ -2,4 +2,3 @@
.Rhistory
.RData
.Ruserdata
*.Rproj
This diff is collapsed.
#header
library(here)
here("output")
rm(list=ls(all=T))
set_wd <- function() {
if(!require(rstudioapi)){
install.packages("rstudioapi")
}
library(rstudioapi)
current_path <- getActiveProject()
setwd(paste(current_path))
print( getwd() )
}
wd<-set_wd()
dir.create("Output",showWarnings = F)
dir.create("Figures",showWarnings = F)
source(file.path("Scripts","dynamic.R"))
model(10,200,500,16)
human_prev<-list()
prev_diff<-list()
log_diff<-list()
prev<-list()
for (i in 1:16){
human_prev[[i]]<-read.table(paste(wd,"/","Output","/","output_scenario",i,"/","data1.txt",sep=""),header = TRUE)
prev_diff[[i]]<-(human_prev[[i]]$H[[length(human_prev[[i]]$H)]]-
human_prev[[1]]$H[[length(human_prev[[1]]$H)]])
log_diff[[i]]<-log(human_prev[[i]]$H[[length(human_prev[[i]]$H)]]/
human_prev[[1]]$H[[length(human_prev[[1]]$H)]])
prev[[i]]<-human_prev[[i]]$H[[length(human_prev[[i]]$H)]]
}
plot(1:200,human_prev[[1]]$H,type="l",col=1,lwd=2,ylab="ESBL prevalence in the open community",xlab="Time in weeks")
lines(1:200,human_prev[[15]]$H,type="l",col=15)
lines(1:200,human_prev[[9]]$H,type="l",col=9)
lines(1:200,human_prev[[14]]$H,type="l",col=14)
lines(1:200,human_prev[[12]]$H,type="l",col=12)
lines(1:200,human_prev[[4]]$H,type="l",col=4)
lines(1:200,human_prev[[5]]$H,type="l",col=5)
lines(1:200,human_prev[[2]]$H,type="l",col=2)
nome2<-c("Baseline","No_far&No_food", "Cross=0.15", "No_food_consum", "High_slaugh_contaminaiton","Short_OC" ,"Fade_ch=0.5" ,"Long_OC" )
rm(list=ls())
legend(130, 0.05, legend=nome2,
col=c(1,15,9,14,12,4,5,2), lty=1,lwd=c(2,1,1,1,1,1,1,1), cex=0.8, text.font=4)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment