From 58faa01748fe0e6f6d040d1296266d17bd7a3543 Mon Sep 17 00:00:00 2001 From: Ben Green Date: Mon, 14 Sep 2015 23:19:34 -0400 Subject: prediction and plotting cascades --- R Scripts/analyze-cascades.R | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'R Scripts/analyze-cascades.R') diff --git a/R Scripts/analyze-cascades.R b/R Scripts/analyze-cascades.R index 463de18..e758d60 100755 --- a/R Scripts/analyze-cascades.R +++ b/R Scripts/analyze-cascades.R @@ -21,7 +21,7 @@ order = rev(order(csize)) plot(sizes,counts,log='xy',type='o',lwd=3, xlab='Size of Cascade', ylab='Number of Cascades', main='Distribution of Cascade Sizes') -i = 14 +i = 4 V = which(clusters(dag)$membership==order[i]) # get all nodes in cluster cc = induced.subgraph(dag,V) Vi = vic_ids[V] @@ -35,8 +35,9 @@ cols[seed] = 'red' plot(cc,vertex.size=10,edge.arrow.size=0.5,vertex.color=cols,vertex.label.cex=1, edge.width=E(cc)$weight*20/max(E(cc)$weight),layout=layout.reingold.tilford(cc,root=seed), vertex.label=V(hyp_lcc)$vic.day[Vi]) -# vertex.label=as.Date(V(hyp_lcc)$vic.day[Vi], format ='%m/%d/%y')) -# vertex.label=V(lcc)$vic_date[Vi]) +plot(cc,vertex.size=10,edge.arrow.size=0.5,vertex.color=cols,vertex.label.cex=1, + layout=layout.reingold.tilford(cc,root=seed)) + ### basic graph statistics trl = mean(transitivity(cc,type='local',isolates='zero')) -- cgit v1.2.3-70-g09d2