Flow Matrix Selection with Statistics and Visualisation

The analysis and representation of flows often presuppose a selection to facilitate interpretation. Various methods have been proposed for selecting flows, one of the most widely used being based on major flows: it selects only the most important flows, absolute or relative, on a local or global scale. These methods often highlight hierarchies between locations, but the loss of information caused by selection is rarely taken into account. We propose statistical indicators to assess the loss of information and the characteristics of selected flows. We provide functions that select flows (main, dominant or major flows), provide statistics on selections and offer visualizations in the form of maps and graphs. See Beauguitte et al. (2015) for more details.


flows: Selections on flow matrices, statistics on selected flows, cartographic and graphic visualizations

flows statusbadge

The analysis and representation of flows often presuppose a selection to facilitate interpretation. Various methods have been proposed for selecting flows, one of the most widely used being based on major flows: it selects only the most important flows, absolute or relative, on a local or global scale. These methods often highlight hierarchies between locations, but the loss of information caused by selection is rarely taken into account. It therefore seems useful to propose statistical indicators to assess the loss of information and the characteristics of selected flows. We provide functions that select flows (main, dominant or major flows), provide statistics on selections and offer visualizations in the form of maps and graphs.

Installation

You can install the development version of flows from r-universe with:

install.packages('flows', repos = c('https://riatelab.r-universe.dev', 'https://cloud.r-project.org'))

Usage

Example of a dominant flows analysis on commuters data:

library(sf)
library(flows)
library(mapsf)
# Import datasets
nav <- read.csv(system.file("csv/nav.csv", package = "flows"))
# Trnasform to wide
mat <- prepare_mat(x = nav, i = "i", j = "j", fij = "fij")
# import spatial objects
UA <- st_read(system.file("gpkg/GE.gpkg", package = "flows"),
  layer = "urban_area", quiet = TRUE
)
GE <- st_read(system.file("gpkg/GE.gpkg", package = "flows"),
  layer = "region", quiet = TRUE
)
# Map
mapsf::mf_get_ratio(GE, 7)
#> [1] 7.000 8.251
mf_map(GE, col = "#c6deba")
out <- map_nodal_flows(
  mat = mat, x = UA,
  inches = .17,
  col_node = c("red", "orange", "yellow"),
  col_flow = "grey30",
  breaks = c(4, 100, 1000, 2500, 8655),
  lwd = c(1, 4, 8, 16), add = TRUE
)
mf_label(out$nodes[out$nodes$w > 6000, ],
  var = "name",
  halo = TRUE, overlap = FALSE, pos = 4
)
mf_title("Dominant Flows of Commuters")
mf_credits("INSEE, 2011")
mf_scale(50)

Ressources

Community Guidelines

One can contribute to the package through pull requests and report issues or ask questions here.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("flows")

2.0.0 by Timothée Giraud, 16 days ago


https://codeberg.org/riatelab/flows


Report a bug at https://codeberg.org/riatelab/flows/issues


Browse source code at https://github.com/cran/flows


Authors: Timothée Giraud [cre, aut] (ORCID: , Laurent Beauguitte [aut] (ORCID: , Marianne Guérois [aut]


Documentation:   PDF Manual  


GPL-3 license


Imports igraph, graphics, mapsf, maplegend, utils, stats

Suggests sf, knitr, rmarkdown


See at CRAN