A few egocentric networks from this project.
Last active
January 1, 2016 20:29
-
-
Save briatte/8197456 to your computer and use it in GitHub Desktop.
egocentric cosponsorship networks in the French National Assembly
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(network) | |
library(sna) | |
load("data/session14.rda") | |
u = ego.extract(net) | |
plot.ego <- function(u, deputes, x, ...) { | |
n = network(u[[ which(names(u) == x) ]]) | |
n %v% "groupe" = deputes[ network.vertex.names(n), "groupe_sigle" ] | |
n %v% "ego" = (network.vertex.names(n) == x) | |
k = net %n% "colors" | |
k = k [ which(names(net %n% "colors") %in% unique(n %v% "groupe")) ] | |
ggnet(n, mode = "kamadakawai", node.group = n %v% "groupe", node.color = k, size = 4, weight = "none", | |
segment.color = "grey35", segment.alpha = .05, ...) + | |
geom_point(color = k [ deputes[ x, "groupe_sigle" ] ], size = 8 * as.numeric(n %v% "ego")) + | |
ggtitle(x) + | |
guides(size = FALSE) | |
} | |
plot.ego("ISABELLE ATTARD") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment