diff options
Diffstat (limited to 'R Scripts/weight-vs-victims.R')
| -rw-r--r-- | R Scripts/weight-vs-victims.R | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/R Scripts/weight-vs-victims.R b/R Scripts/weight-vs-victims.R new file mode 100644 index 0000000..da60df2 --- /dev/null +++ b/R Scripts/weight-vs-victims.R @@ -0,0 +1,10 @@ +# testing to see if pairs connected by high weight edges are more likely to both be +# victims than pairs connected by low weight edges. This would provide some evidence +# that high weight edges are important for transmitting infections. + +v = rep(0,max(lcc_edges$weight)) +for(w in 1:max(lcc_edges$weight)){ + es = lcc_edges[lcc_edges$weight==w,1:2] + v[w] = mean(lcc_verts$vic[as.numeric(es$from)] & lcc_verts$vic[as.numeric(es$to)]) +} +plot(v)
\ No newline at end of file |
