diff options
Diffstat (limited to 'R Scripts/data-exploration.R')
| -rwxr-xr-x | R Scripts/data-exploration.R | 14 |
1 files changed, 14 insertions, 0 deletions
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))) + + + |
