flow_distance | R Documentation |
This function calculates flow distance and dissimilarity measures between all pairs of flows based on the method described in @tao2016spatial.
flow_distance(x, alpha = 1, beta = 1)
x |
tibble with flow_ID, x, y, u, v, length_m |
alpha |
numeric, origin weight |
beta |
numeric, destination weight |
tibble of all OD pairs with fd, fds columns
Tao, R., Thill, J.-C., 2016. Spatial cluster detection in spatial flow data. Geographical Analysis 48, 355–372. https://doi.org/10.1111/gean.12100
flows <- sf::st_transform(flows_leeds, 3857)
flows <- head(flows, 100) # for testing
# Add flow lengths and coordinates
flows <- add_flow_length(flows)
flows <- add_xyuv(flows)
# Calculate distances
distances <- flow_distance(flows, alpha = 1.5, beta = 0.5)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.