summaryrefslogtreecommitdiffstats
path: root/R Scripts/min_inf_time.R
blob: 914af61811638d703474def1263d058ef6f46579 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# analyze min possible infection time
i = 1
min_time = 0#rep(Inf,length(unique(dag_dat_vics$to)))
min_time_dist = 0#rep(Inf,length(unique(dag_dat_vics$to)))
for(to in unique(dag_dat_vics$to)){
  rows = which(dag_dat_vics$to==to & dag_dat_vics$dist<2)
  if(length(rows)>0){
    min_time[i] = min(dag_dat_vics$t2[rows]-dag_dat_vics$t1[rows])
    min_time_dist[i] = dag_dat_vics$dist[rows[which.min(dag_dat_vics$t2[rows]-dag_dat_vics$t1[rows])]]
    i = i + 1
  }
}
median(min_time)
mean(min_time<100)
save(min_time_1,min_time_2,min_time_3,file='Results/min_inf_time.RData')