powered by
Count of nodes reachable within shortest path distance k. Measures how many nodes a given node can reach quickly.
k
centrality_kreach(x, mode = "all", k = 3, ...)
Named numeric vector of k-reach centrality values.
Network input (matrix, igraph, network, cograph_network, tna object).
For directed networks: "all" (default), "in", or "out".
"all"
"in"
"out"
Maximum path length. Default 3.
Additional arguments passed to centrality (e.g., weighted, directed, invert_weights).
centrality
weighted
directed
invert_weights
centrality for computing multiple measures at once.
adj <- matrix(c(0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0), 4, 4) rownames(adj) <- colnames(adj) <- c("A", "B", "C", "D") centrality_kreach(adj, k = 2)
Run the code above in your browser using DataLab