# NOT RUN {
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)
# }
Run the code above in your browser using DataLab