From 75868035a6e363c2ad67ff0342440aff3972a970 Mon Sep 17 00:00:00 2001 From: Ben Green Date: Sun, 4 Oct 2015 17:18:05 -0400 Subject: .. --- R Scripts/data-exploration.R | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'R Scripts/data-exploration.R') diff --git a/R Scripts/data-exploration.R b/R Scripts/data-exploration.R index f8f6892..22ec60c 100755 --- a/R Scripts/data-exploration.R +++ b/R Scripts/data-exploration.R @@ -33,6 +33,17 @@ plot(1:max(degree(lcc)),degree.distribution(lcc)[-1]*vcount(lcc), xlab='Degree', ylab='Number of vertices', main='') pl = power.law.fit(degree.distribution(lcc)) +##### small-worldness of lcc +trg = transitivity(lcc,type='global') +trl = mean(transitivity(lcc,type='local',isolates='zero')) +apl = average.path.length(lcc) + +erg = erdos.renyi.game(n=vcount(lcc),p.or.m=ecount(lcc),type='gnm') +transitivity(erg,type='global') +mean(transitivity(erg,type='local',isolates='zero')) +average.path.length(erg) + + ##### Victims vic_ids = which(V(lcc)$vic==TRUE) non_vic_ids = which(V(lcc)$vic==FALSE) @@ -53,3 +64,6 @@ sum(sum(!is.na(lcc_verts$fatal_day)), sum(!is.na(lcc_verts$nonfatal_day_3)), sum(!is.na(lcc_verts$nonfatal_day_4)), sum(!is.na(lcc_verts$nonfatal_day_5))) + + + -- cgit v1.2.3-70-g09d2