Learn R Programming

cartograflow (version 1.0.0)

flowgini: Analysis of flow concentration (Gini coefficient)

Description

Calculates Gini coefficient, plot Lorenz curve and threshold the matrice according to a global concentration criterion for mapping flow intensity or flow density). To be use before flowanalysis

Usage

flowgini(tab, origin, dest, valflow, format, fdc, code, lorenz.plot)

Arguments

tab

dataset is a matrice or long format

origin

origin place to be used with the long format

dest

destination place to be used with the list format

valflow

to be used with the list format

format

is a variable that identify the data : matrice or long format

fdc

is the map background file, ie. a shapefile.

code

is the map background IDs code

lorenz.plot

allows to plot the Lorenz curve associate to the gini coefficient

Value

plot Lorenz curve for the cumulated flow and links : flowgini(...,gini.plot = TRUE),warning : the function must be not assign a variable

value of the Gini's coefficent and the table : table<-flowgini(...,missing(gini.plot) or gini.plot = FALSE )

Details

flowgini(...,lorenz.plot = TRUE) for ploting Lorenz curve from cumulated flows and links.

References

Bahoken Fran<U+00E7>oise, 2016,<U+00AB> La cartographie d<U+2019>une s<U+00E9>lection globale de flux, entre <U+2018>significativit<U+00E9><U+2019> et <U+2018>densit<U+00E9><U+2019> <U+00BB>, Netcom Online, 30-3/4 | 2016, Online since 23 March 2017, connection on 05 May 2019. URL : http://journals.openedition.org/netcom/2565 ; DOI : 10.4000/netcom.2565. Grasland Claude, 2014, "Flows analysis carto", unpublished R functions.

Examples

Run this code
# NOT RUN {
library(cartograflow)
data(flowdata)
bkg<- system.file("shape/MGP_TER.shp", package="cartograflow",
                  lib.loc = NULL, mustWork = TRUE)
#Computes Gini's coefficent
tab_gini<-flowgini(flows,format="L",origin="i",dest="j",valflow="Fij",
          bkg,code="EPT_NUM",lorenz.plot = FALSE)
#Plot Lorenz curve
flowgini(tab_gini,format="L",origin="i",dest="j",valflow="ydata",
          bkg,code="EPT_NUM",lorenz.plot = TRUE)
#See \link{flowanalysis} for viewing the tab_gini table
# }

Run the code above in your browser using DataLab