actor_matrix <- bipartite_matrix %*% t(bipartite_matrix) event_matrix <- t(bipartite_matrix) %*% bipartite_matrix diag(actor_matrix) <- 0 actor_matrix actor_matrix_cff_2 <- ifelse(actor_matrix > 2, actor_matrix, 0) # cuttoff 3 below actor_matrix_cff_3 <- ifelse(actor_matrix > 3, actor_matrix, 0) # cuttoff 3 below actor_g <- graph_from_adjacency_matrix(actor_matrix, mode = "undirected", weighted = TRUE) actor_g_cff_2 <- graph_from_adjacency_matrix(actor_matrix_cff_2, mode = "undirected", weighted = TRUE) actor_g_cff_3 <- graph_from_adjacency_matrix(actor_matrix_cff_3, mode = "undirected", 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_cff_2 actor_g_cff_3 event_g <- graph_from_adjacency_matrix(event_matrix, mode = "undirected", weighted = TRUE) event_g windowsFonts(d2coding = windowsFont("D2Coding")) windowsFonts(lucida = windowsFont("Lucida Console")) shape <- c("circle", "square") fnts <- c("d2coding", "lucida") plot(actor_g, 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_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 )