r:social_network_analysis
                Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| r:social_network_analysis [2023/06/12 03:27] – [stu x class 처럼 분석한 예] hkimscil | r:social_network_analysis [2024/11/14 09:02] (current) – [Hawthorne study] hkimscil | ||
|---|---|---|---|
| Line 8: | Line 8: | ||
| {{: | {{: | ||
| < | < | ||
| - | library(tidiverse) | + | # install.packages(c(" | 
| + | library(igraph) | ||
| + | library(tidyverse) | ||
| sd <- read.csv(" | sd <- read.csv(" | ||
| head(sd) | head(sd) | ||
| Line 27: | Line 30: | ||
| < | < | ||
| + | V(g)$type <- bipartite_mapping(g)$type | ||
| types <- V(g)$type | types <- V(g)$type | ||
| deg <- degree(g) | deg <- degree(g) | ||
| Line 183: | Line 187: | ||
| 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 199: | ||
| 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 = " | + | mode = " | 
| - |  | + |  | 
| 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 = " | + | mode = " | 
| - |  | + |  | 
| + | |||
| + | 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 220: | ||
|  |  | ||
| 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(" | windowsFonts(d2coding = windowsFont(" | ||
| windowsFonts(lucida = windowsFont(" | windowsFonts(lucida = windowsFont(" | ||
| - | windowsFonts(courrier = windowsFont(" | ||
| shape <- c(" | shape <- c(" | ||
| fnts <- c(" | fnts <- c(" | ||
| - | plot(actor_g, | + | plot(actor_g, | 
|  |  | ||
| - |  | + |  | 
| - | ) | + |  | 
| + | ) | ||
| + | plot(actor_g_cff_2, | ||
| + |  | ||
| + |  | ||
| + |  | ||
| + | ) | ||
| + | plot(actor_g_cff_3, | ||
| + |  | ||
| + |  | ||
| + |  | ||
| + | ) | ||
| </ | </ | ||
| - | {{: | + | [{{: | 
| - | {{: | + | [{{: | 
| - | {{: | + | [{{: | 
r/social_network_analysis.1686508049.txt.gz · Last modified:  by hkimscil
                
                