User Tools

Site Tools


r:social_network_analysis

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
r:social_network_analysis [2023/06/12 03:28] – [stu x class 처럼 분석한 예] hkimscilr:social_network_analysis [2023/11/22 22:02] (current) – [Hawthorne study] hkimscil
Line 27: Line 27:
  
 <code> <code>
 +V(g)$type <- bipartite_mapping(g)$type
 types <- V(g)$type       types <- V(g)$type      
 deg <- degree(g) deg <- degree(g)
Line 183: Line 184:
 actor_matrix <- bipartite_matrix %*% t(bipartite_matrix) actor_matrix <- bipartite_matrix %*% t(bipartite_matrix)
 event_matrix <- t(bipartite_matrix) %*% bipartite_matrix event_matrix <- t(bipartite_matrix) %*% bipartite_matrix
 +
  
 diag(actor_matrix) <- 0 diag(actor_matrix) <- 0
Line 194: Line 196:
  
 actor_g_cff_2 <- graph_from_adjacency_matrix(actor_matrix_cff_2,  actor_g_cff_2 <- graph_from_adjacency_matrix(actor_matrix_cff_2, 
-                                       mode = "undirected",  +                                             mode = "undirected",  
-                                       weighted = TRUE)+                                             weighted = TRUE)
 actor_g_cff_3 <- graph_from_adjacency_matrix(actor_matrix_cff_3,  actor_g_cff_3 <- graph_from_adjacency_matrix(actor_matrix_cff_3, 
-                                       mode = "undirected",  +                                             mode = "undirected",  
-                                       weighted = TRUE)+                                             weighted = TRUE) 
 + 
 +V(actor_g)$size <- betweenness(actor_g) 
 +V(actor_g_cff_2)$size <- betweenness(actor_g_cff_2) 
 +V(actor_g_cff_3)$size <- betweenness(actor_g_cff_3) 
 +V(actor_g)$label.cex <- betweenness(actor_g) * 0.2 
 +V(actor_g_cff_2)$label.cex <- betweenness(actor_g_cff_2) * 0.1 
 +V(actor_g_cff_3)$label.cex <- betweenness(actor_g_cff_3) * 0.4 
 actor_g actor_g
 actor_g_cff_2 actor_g_cff_2
Line 207: Line 217:
                                        weighted = TRUE)                                        weighted = TRUE)
 event_g event_g
- 
-plot(actor_g)  
-plot(actor_g_cff_2)  
-plot(actor_g_cff_3)  
- 
-# V(actor_g)$size <- degree(actor_g) 
-# V(actor_g)$label.cex <- degree(actor_g) * 0.1 
- 
  
 windowsFonts(d2coding = windowsFont("D2Coding")) windowsFonts(d2coding = windowsFont("D2Coding"))
 windowsFonts(lucida = windowsFont("Lucida Console")) windowsFonts(lucida = windowsFont("Lucida Console"))
-windowsFonts(courrier = windowsFont("Courrier New")) 
  
 shape <- c("circle", "square") shape <- c("circle", "square")
 fnts <- c("d2coding", "lucida") fnts <- c("d2coding", "lucida")
  
-plot(actor_g_cff_3, layout = layout_with_graphopt,+plot(actor_g     
      vertex.shape= shape[as.numeric(V(g)$type) + 1],      vertex.shape= shape[as.numeric(V(g)$type) + 1],
-     vertex.label.family= fnts[as.numeric(V(g)$type)+1] +     vertex.label.family= fnts[as.numeric(V(g)$type)+1]
-+     edge.color="red", edge.width=3 
 +)  
 +plot(actor_g_cff_2, 
 +     vertex.shape= shape[as.numeric(V(g)$type) + 1], 
 +     vertex.label.family= fnts[as.numeric(V(g)$type)+1], 
 +     edge.color="red", edge.width=3 
 +)  
 +plot(actor_g_cff_3, 
 +     vertex.shape= shape[as.numeric(V(g)$type) + 1], 
 +     vertex.label.family= fnts[as.numeric(V(g)$type)+1], 
 +     edge.color="red", edge.width=3 
 +
 </code> </code>
  
-{{:r:pasted:20230612-032552.png}} +[{{:r:pasted:20230612-081851.png|actor_g}}] \\ 
-{{:r:pasted:20230612-032626.png}} +[{{:r:pasted:20230612-082040.png|actor_g_cff_2}}] \\ 
-{{:r:pasted:20230612-032635.png}}+[{{:r:pasted:20230612-082055.png|actor_g_cff_3}}]
  
  
r/social_network_analysis.1686508125.txt.gz · Last modified: 2023/06/12 03:28 by hkimscil

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki