# NOT RUN {
library(cartograflow)
data(flowdata)
bkg<- system.file("shape/MGP_TER.shp", package="cartograflow",
lib.loc = NULL, mustWork = TRUE)
#1/4: Computes Gini's coefficent
tab_gini<-flowgini(flows,format="L",origin="i",dest="j",valflow="Fij",
bkg,code="EPT_NUM",lorenz.plot = FALSE)
### [1] Gini's coefficent = 73.16 %
# }
# NOT RUN {
#2/4: Plot Lorenz curve
flowgini(tab_gini,format="L",origin="i",dest="j",valflow="ydata",
bkg,code="EPT_NUM",lorenz.plot = TRUE)
# }
# NOT RUN {
#3/4: Compute critflow filtering parameter
#critflow = 0.8 #selected criterion
flowanalysis(tab_gini,critflow = 0.8,result = "signif")
### [1] "threshold = 11238 --- flows = 80 % --- links = 22.94 %"
#4/4: Plot the flowmap
# }
# NOT RUN {
flowmap(flows,format="L",bkg,code = "EPT_NUM",filter = TRUE,
threshold = 11238,taille = 8,a.head = 1,a.length = 0.11,
a.angle = 30,a.col="#3f4247")
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab