sna_eg_stanford:lab02
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revisionNext revisionBoth sides next revision | ||
sna_eg_stanford:lab02 [2019/11/29 09:11] – created hkimscil | sna_eg_stanford:lab02 [2019/11/29 09:33] – hkimscil | ||
---|---|---|---|
Line 107: | Line 107: | ||
for (i in 1: | for (i in 1: | ||
reach_mat[i, | reach_mat[i, | ||
- | this_node_reach <- subcomponent(g, | + | this_node_reach <- subcomponent(g, |
for (j in 1: | for (j in 1: | ||
- | alter = this_node_reach[j] | + | alter = this_node_reach[j] |
reach_mat[i, | reach_mat[i, | ||
} | } | ||
Line 553: | Line 553: | ||
#set probability of edge formation in random graph to proportion of possible edges present in original | #set probability of edge formation in random graph to proportion of possible edges present in original | ||
p.edge <- n.edges/ | p.edge <- n.edges/ | ||
- | r.graph <- as.network.numeric(n.nodes, density = p.edge) | + | r.graph <- as.network(n.nodes, |
- | r.igraph <- as.igraph(r.graph) | + | |
+ | r.igraph <- asIgraph(r.graph) | ||
+ | ################################## | ||
tc.graph <- triad.census(r.igraph) | tc.graph <- triad.census(r.igraph) | ||
clust <- sum(tc.graph*my.mask) | clust <- sum(tc.graph*my.mask) |
sna_eg_stanford/lab02.txt · Last modified: 2019/12/11 08:52 by hkimscil