| ego_networks | R Documentation |
Extracts the ego network of each requested node (the node, its neighbors up to a given order, and the ties among them) and reports a tidy table of personal-network metrics: size, internal tie counts and densities, and Burt's structural-hole measures. One row per ego.
ego_networks(
x,
nodes = NULL,
order = 1,
mode = c("all", "out", "in"),
directed = NULL,
...
)
x |
Network input: matrix, igraph, network, cograph_network, or tna object. |
nodes |
Character vector of node names or integer vector of node indices selecting which egos to report. NULL (default) uses every node. |
order |
Integer neighborhood order defining the ego network. 1
(default) is the standard ego network (ego + direct neighbors). Burt's
|
mode |
For directed networks, which ties define the neighborhood:
|
directed |
Logical or NULL. If NULL (default), auto-detect from matrix symmetry. |
... |
Currently unused; |
effective_size and constraint are computed on the full network
(Burt's measures are defined directly from each node's order-1 ego network),
reusing the same implementations as centrality so results match
centrality(x, measures = c("effective_size", "constraint")).
A tidy data.frame of class "cograph_ego_networks" with one row
per ego and columns:
Ego node name.
Number of alters (ego-network size, excluding ego).
Number of edges in the ego network (ego + alters).
Edge density of the ego network including ego.
Number of edges among the alters only (excluding ego).
Edge density among the alters. Low values indicate many structural holes / brokerage opportunities.
Burt's effective size of the ego network
(order = 1 only).
Burt's constraint (order = 1 only).
Burt, R.S. (1992). Structural Holes: The Social Structure of Competition. Harvard University Press.
centrality (for effective_size, constraint,
dispersion), select_neighbors, neighborhood_overlap
adj <- matrix(c(
0, 1, 1, 0, 0,
1, 0, 1, 0, 0,
1, 1, 0, 1, 1,
0, 0, 1, 0, 1,
0, 0, 1, 1, 0
), 5, 5, byrow = TRUE)
rownames(adj) <- colnames(adj) <- LETTERS[1:5]
cograph::ego_networks(adj)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.