{"id":19339173,"url":"https://github.com/riatelab/flows","last_synced_at":"2025-04-23T02:30:33.745Z","repository":{"id":29002111,"uuid":"32529063","full_name":"riatelab/flows","owner":"riatelab","description":"Flow selection and analysis","archived":false,"fork":false,"pushed_at":"2024-05-06T12:23:15.000Z","size":5294,"stargazers_count":14,"open_issues_count":1,"forks_count":2,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-12T01:59:33.827Z","etag":null,"topics":["cran","flows","r","r-package"],"latest_commit_sha":null,"homepage":"","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/riatelab.png","metadata":{"files":{"readme":"README.Rmd","changelog":"NEWS","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":"codemeta.json","zenodo":null}},"created_at":"2015-03-19T15:16:17.000Z","updated_at":"2025-03-23T07:35:34.000Z","dependencies_parsed_at":"2024-11-10T03:33:19.075Z","dependency_job_id":null,"html_url":"https://github.com/riatelab/flows","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/riatelab%2Fflows","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/riatelab%2Fflows/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/riatelab%2Fflows/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/riatelab%2Fflows/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/riatelab","download_url":"https://codeload.github.com/riatelab/flows/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250357506,"owners_count":21417288,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cran","flows","r","r-package"],"created_at":"2024-11-10T03:20:18.499Z","updated_at":"2025-04-23T02:30:33.339Z","avatar_url":"https://github.com/riatelab.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"---\noutput: github_document\n---\n\n```{r, include = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  fig.path = \"man/figures/\",\n  fig.width = 7, fig.height = 8,\n  dev = \"png\"\n)\n```\n\n\n\n# `flows`: Selections on flow matrices, statistics on selected flows, cartographic and graphic visualizations \u003cimg src=\"man/figures/logo.png\" align=\"right\" width=\"140\"/\u003e\n\n\u003c!-- badges: start --\u003e\n[![Version](http://www.r-pkg.org/badges/version/flows)](https://cran.r-project.org/package=flows/)\n[![R-CMD-check](https://github.com/riatelab/flows/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/riatelab/flows/actions/workflows/R-CMD-check.yaml)\n\u003c!-- badges: end --\u003e\n\nThe analysis and representation of flows often presuppose a selection\nto facilitate interpretation. Various methods have been proposed for selecting\nflows, one of the most widely used being based on major flows: it selects only\nthe most important flows, absolute or relative, on a local or global scale.\nThese methods often highlight hierarchies between locations, but the loss of\ninformation caused by selection is rarely taken into account. It therefore\nseems useful to propose statistical indicators to assess the loss of information\nand the characteristics of selected flows. We provide functions that select\nflows (main, dominant or major flows), provide statistics on selections and\noffer visualizations in the form of maps and graphs.\n\n## Installation\n\nYou can install the development version of flows from GitHub with:\n\n```{r, eval = FALSE}\nremotes::install_github(\"riatelab/flows\")\n```\n\n## Usage\n\nExample of a dominant flows analysis on commuters data:\n\n```{r, warning=FALSE, message=FALSE}\nlibrary(sf)\nlibrary(flows)\nlibrary(mapsf)\n# Import datasets\nnav \u003c- read.csv(system.file(\"csv/nav.csv\", package = \"flows\"))\n# Trnasform to wide\nmat \u003c- prepare_mat(x = nav, i = \"i\", j = \"j\", fij = \"fij\")\n# import spatial objects\nUA \u003c- st_read(system.file(\"gpkg/GE.gpkg\", package = \"flows\"),\n  layer = \"urban_area\", quiet = TRUE\n)\nGE \u003c- st_read(system.file(\"gpkg/GE.gpkg\", package = \"flows\"),\n  layer = \"region\", quiet = TRUE\n)\n# Map\nmf_map(GE, col = \"#c6deba\")\nout \u003c- map_nodal_flows(\n  mat = mat, x = UA,\n  inches = .17,\n  col_node = c(\"red\", \"orange\", \"yellow\"),\n  col_flow = \"grey30\",\n  breaks = c(4, 100, 1000, 2500, 8655),\n  lwd = c(1, 4, 8, 16), add = TRUE\n)\nmf_label(out$nodes[out$nodes$w \u003e 6000, ],\n  var = \"name\",\n  halo = TRUE, overlap = FALSE, pos = 4\n)\nmf_title(\"Dominant Flows of Commuters\")\nmf_credits(\"INSEE, 2011\")\nmf_scale(50)\n```\n\n## Ressources\n\n* [Beauguitte, L., Giraud, T. et Guérois, M. (2015). Un outil pour la sélection et la visualisation de flux : le package flows. Netcom, 29(3/4), 399-408.](https://journals.openedition.org/netcom/2134) \u003csmall\u003e(This paper is in French and refers to previous versions of the package.)\u003c/small\u003e\n* Package vignette \n\n## Community Guidelines\n\nOne can contribute to the package through [pull\nrequests](https://github.com/riatelab/flows/pulls) and report issues or\nask questions [here](https://github.com/riatelab/flows/issues).  \n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Friatelab%2Fflows","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Friatelab%2Fflows","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Friatelab%2Fflows/lists"}