Learn R Programming

cartograflow (version 1.0.3)

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(ODpts, origin, destination, valflow, lorenz.plot)

Arguments

ODpts

the input dataset with : nodes code, flow values and XY coordinates

origin

ID origin place, in long format

destination

ID destination place, long format

valflow

flow value between origin and destination places

lorenz.plot

to plot or the Lorenz curve. See Details

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 associate to the gini coefficient, 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)
# Computes Gini's coefficent
tabgini <- flowgini(ODpts = flows, origin = "i", destination = "j", 
                     valflow = "Fij", lorenz.plot = FALSE)
# Plot Lorenz curve
flowgini(ODpts = flows, origin = "i", dest = "j", valflow = "Fij", lorenz.plot = TRUE)
# See \link{flowanalysis} for viewing the tab_gini table
# }

Run the code above in your browser using DataLab