spatial_centrality: Compute spatial centrality measures

spatial_centralityR Documentation

Compute spatial centrality measures

Description

These functions are a collection of centrality measures that are specific for spatial networks, and form a spatial extension to centrality measures in tidygraph.

Usage

centrality_straightness(...)

Arguments

...

Additional arguments passed on to other functions.

Details

Just as with all centrality functions in tidygraph, these functions are meant to be called inside tidygraph verbs such as mutate or filter, where the network that is currently being worked on is known and thus not needed as an argument to the function. If you want to use an algorithm outside of the tidygraph framework you can use with_graph to set the context temporarily while the algorithm is being evaluated.

Value

A numeric vector of the same length as the number of nodes in the network.

Functions

  • centrality_straightness(): The straightness centrality of node i is the average ratio of Euclidean distance and network distance between node i and all other nodes in the network. ... is forwarded to st_network_distance to compute the network distance matrix. Euclidean distances are computed using st_distance.

Examples

library(tidygraph, quietly = TRUE)

net = as_sfnetwork(roxel, directed = FALSE)

net |>
  activate(nodes) |>
  mutate(sc = centrality_straightness())


luukvdmeer/sfnetworks documentation built on Nov. 21, 2024, 4:54 a.m.