ntcls
Closeness of each node
ntcls(from, to, nodes = NULL, dir = FALSE)Distances are counted in steps (weights are not taken), along edges’
directions when dir = TRUE (out-distances). A disconnected graph is
handled in the two standard ways, both returned: cls and ncls count
only the nodes a node reaches (as igraph::closeness() does), so a node
close to the few it reaches scores high; hrm, the harmonic centrality,
sums 1 / distance over every other node, an unreachable one adding 0,
so reaching more nodes always scores more. Graph rules as in ntdeg().
Parameters
Section titled “Parameters”from, toLabels of the two ends of each edge: vectors of the same length (zero when
nodesgives every node) with no missing values.nodesNULL, or every node’s label once: the node order of the results and the way to include isolated nodes.dirTRUEfor a directed graph (fromsends a tie toto).
Returns
Section titled “Returns”A data frame: node, reach (nodes reached), cls (1 / the
summed distance to them), ncls (reach / that sum, the inverse mean
distance; cls and ncls are NaN when nothing is reached) and hrm
(the harmonic centrality).
References
Section titled “References”Freeman, L. C. (1978). Centrality in social networks: conceptual clarification. Social Networks, 1(3), 215-239. doi:10.1016/0378-8733(78)90021-7
Marchiori, M. and Latora, V. (2000). Harmony in the small-world. Physica A, 285(3-4), 539-546. doi:10.1016/S0378-4371(00)00311-3
Examples
Section titled “Examples”ntcls(c(1, 2, 3), c(2, 3, 4), nodes = 1:5)Generated from the R help page: ntcls in the R reference.