# 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')