flowcarre: Create a square matrice from geographical ID

Description Usage Arguments Details Examples

View source: R/flowcarre.R

Description

Create a closed and square matrice from a list of geographic ID

Usage

1
flowcarre(liste, tab, origin, dest, valflow, empty.sq, format, diagonale)

Arguments

liste

list or all the geographical ID as a single vector flow dataset

tab

the non squared input flow dataset with three column : origin, destination, flow value

origin

origin place

dest

destination place

valflow

flow value

empty.sq

TRUE : to allows to have an matrice empty with only the ID of background map ; FALSE or missing

format

the squared flow dataset output format. See Details.

diagonale

See Details.

Details

- format is "M" for matrice format

- format is "L" for long format

- diagonal is "TRUE" to zero the main diagonal

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
library(cartograflow)
data(flowdata)
var1<-geoid
var2<-flows

#1/2 Compute an empty square matrice with ID code, and sets the value to zero
#Example for matrice format (same procedure for the long format)

mat<-flowcarre(var1,var2,origin="i",dest="j",valflow="Fij",
               format="M",empty.sq=TRUE)

#2/2 Fill in the matrice with external flow values
mat<-flowcarre(var1,var2,origin="i",dest="j",valflow="Fij",
               format="M",empty.sq=FALSE)

#Square a matrice and zero the main diagonal
mat<-flowcarre(var1,var2,origin="i",dest="j",valflow="Fij",format="M",
               empty.sq=FALSE,diagonale = FALSE)

fbahoken/cartogRaflow documentation built on May 21, 2019, 1:43 p.m.