View source: R/wrangle-structure.R
| select_k_core | R Documentation |
The k-core is the maximal subgraph in which every node has degree at least
k, found by repeatedly removing nodes of degree below k.
select_k_core(x, k, keep_format = FALSE, directed = NULL)
x |
Network input. |
k |
Integer. The core number. |
keep_format |
Logical. Return the input format when TRUE. |
directed |
Logical or NULL. If NULL (default), auto-detect. |
A cograph_network holding the k-core, or the input format
when keep_format = TRUE. An empty network when no node reaches
coreness k.
Seidman, S. B. (1983). Network structure and minimum degree. Social Networks, 5(3), 269–287.
select_nodes, centrality
adj <- matrix(c(0, 1, 1, 1,
1, 0, 1, 0,
1, 1, 0, 0,
1, 0, 0, 0), 4, 4, byrow = TRUE)
rownames(adj) <- colnames(adj) <- c("A", "B", "C", "D")
select_k_core(adj, k = 2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.