flowdist: Builds a continuous distance matrices from a spatial features...

Description Usage Arguments Details Value Examples

View source: R/flowdist.R

Description

From a layer of areal spatial features, compute and threshold a continuous distance matrix. The result is either a matrice of distances between ODs, or a flow matrix based on the distance travelled between ODs ; both can be used for filtering flow before flow mapping (flowmap)

Usage

1
flowdist(tab, dist.method, result)

Arguments

tab

the input flow dataset

dist.method

distance calculation algorithm, default is euclidian calculation

result

Choose Building a "flowdist" or a simple "dist" matrice. See Details

Details

– result = "dist" is the simple resulting distance matrice.
– result = "flowdist" is the resulting distance matrice with additional calculated parameters.
– It is also possible to filter flow by a level of distance travelled.

Value

(1) A flowdata set with continuous distances calculations. See dist.method parameter

(2) A flowdata set with movement from euclidian distances calculations

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
library(cartograflow)
library(sf)
data(flowdata)
map <- st_read(system.file("shape/MGP_TER.shp", package = "cartograflow"))
tabflow <- flowjointure(
  geom = "area", bkg = map, DF.flow = flows, origin = "i",
  destination = "j", id = "EPT_NUM", x = "X", y = "Y"
)

# Format long with only origin, destination and distance parameters:
tab.distance <- flowdist(tabflow, dist.method = "euclidian", result = "dist")
# Format long with with all parameters: coordinates, distance, mouvement
tab.distance <- flowdist(tabflow, dist.method = "euclidian", result = "flowdist")

fbahoken/cartogRaflow documentation built on Oct. 15, 2021, 11:09 a.m.