flowtabmat: Changing the format of a flow dataset

Description Usage Arguments Details Value Examples

View source: R/flowtabmat.R

Description

Transform a flow dataset from long to matrice format, and vice versa. Square matrice.

Usage

1
flowtabmat(tab, matlist)

Arguments

tab

flow dasaset, in matrice or long format

matlist

choose "matrice" or "long" for the resulting format. See Details.

Details

- matlist="M" from long (3 columns : origin, destination, flow) to matrice format [n*n];
- matlist="L" from matrice to long format.

Value

a flow dataset in matrice or in long format

Examples

1
2
3
4
5
6
library(cartograflow)
data(flowdata)
# 1: From long to matrix format (n*m)
matFlow <- flowtabmat(flows, matlist = "M")
# 2: From matrix to long format [i,j,Fij]
listflow <- flowtabmat(matFlow, matlist = "L")

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