summaryrefslogtreecommitdiffstats
path: root/R Scripts/data-exploration.R
diff options
context:
space:
mode:
authorBen Green <bgreen@g.harvard.edu>2015-09-18 23:38:46 -0400
committerBen Green <bgreen@g.harvard.edu>2015-09-18 23:38:48 -0400
commitbb68c49552f69b90ce840dbd7346fc76eb93e3e3 (patch)
treea5a184d2403eb16dbadf9cbf9a1f32f540d5ab00 /R Scripts/data-exploration.R
parenta585b261dace47783fdae28130c8e4792627a230 (diff)
downloadcriminal_cascades-bb68c49552f69b90ce840dbd7346fc76eb93e3e3.tar.gz
pretty plots!
Diffstat (limited to 'R Scripts/data-exploration.R')
-rwxr-xr-xR Scripts/data-exploration.R7
1 files changed, 4 insertions, 3 deletions
diff --git a/R Scripts/data-exploration.R b/R Scripts/data-exploration.R
index f9617f9..16e7bba 100755
--- a/R Scripts/data-exploration.R
+++ b/R Scripts/data-exploration.R
@@ -28,9 +28,10 @@ S = data.frame(C_dat = trl,
S
##### Degree Distribution
-plot(degree.distribution(lcc)*vcount(lcc),log='xy',type='l',col='red',lwd=2,
- xlab='Degree', ylab='Number of Vertices', main='Degree Distribution')
-
+plot(1:max(degree(lcc)),degree.distribution(lcc)[-1]*vcount(lcc),
+ log='xy',col='#377EB8',pch=20,
+ xlab='Degree', ylab='Number of Vertices', main='')
+pl = power.law.fit(degree.distribution(lcc))
##### Victims
vic_ids = which(V(lcc)$vic==TRUE)