flowtype: Compute flowdata types (volum, balance)

Description Usage Arguments Details References Examples

View source: R/flowtype.R

Description

Compute gross (volumn) and net (balance) flows from initial asymetric flow values

Usage

1
flowtype(tab, format, x)

Arguments

tab

is the input flow dataset

format

specify the flow dataset format, "M " for square matrix [n*n] or L for long [i,j,data]

x

enter the computation type : "flux", "transpose", "bivolum" and "bisold".

Details

The matrice must be squared (if not, see flowcarre). This function compute for all pairs or origin-destination places (i,j) involved in an asymetric flow matrix (Fij<> Fji) several matrix :
- x = "flux" for remaining initial flow (Fij)
- x = "transpose" for reverse flow value (Fji)
- x = "bivolum" for bilateral gross flow Vij=(Fij+Fji)
- x = "bisold" for bilateral net flow Sij=(Fij-Fji)

References

Bahoken Francoise, 2016, L'approche cartographique de la décomposition des matrices de flux, Mappemonde, Revue sur l'image géographique et les formes du territoire, number 116, URL : https://mappemonde-archive.mgm.fr/num44/articles/art14404.html

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
library(cartograflow)
data(flowdata)
bkg <- system.file("shape/MGP_TER.shp",
  package = "cartograflow",
  lib.loc = NULL, mustWork = TRUE
)

## 1a:Computes flowtypes: Matrice format
matflow <- flowtabmat(flows, matlist = "M")
m <- flowtype(matflow, format = "M", x = "flux")
m <- flowtype(matflow, format = "M", x = "transpose")
m <- flowtype(matflow, format = "M", x = "bivolum")
m <- flowtype(matflow, format = "M", x = "bisold")

## 1b:Computes flowtypes: Long format
list <- flowtabmat(matflow, matlist = "L")
colnames(list) <- c("i", "j", "Fij")
l_all <- flowtype(list, format = "L", x = "all")
l_sold <- flowtype(list, format = "L", x = "bisold")

# 2:flowmapping: example of bisold
flowmap(l_sold,
  format = "L", bkg, code = "EPT_NUM",
  filter = TRUE, threshold = 20, taille = 5
)

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