{"id":14067943,"url":"https://github.com/riatelab/potential","last_synced_at":"2025-08-10T12:25:31.976Z","repository":{"id":56935443,"uuid":"299638444","full_name":"riatelab/potential","owner":"riatelab","description":"An R package to compute the potential model as defined by Stewart (1941).","archived":false,"fork":false,"pushed_at":"2022-12-13T12:21:18.000Z","size":20954,"stargazers_count":28,"open_issues_count":0,"forks_count":2,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-13T12:56:34.816Z","etag":null,"topics":["rspatial","stewart"],"latest_commit_sha":null,"homepage":"https://riatelab.github.io/potential/","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.md","changelog":"NEWS.md","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":"2020-09-29T14:13:19.000Z","updated_at":"2025-03-23T07:32:26.000Z","dependencies_parsed_at":"2023-01-28T12:16:13.286Z","dependency_job_id":null,"html_url":"https://github.com/riatelab/potential","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/riatelab%2Fpotential","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/riatelab%2Fpotential/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/riatelab%2Fpotential/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/riatelab%2Fpotential/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/riatelab","download_url":"https://codeload.github.com/riatelab/potential/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250357484,"owners_count":21417282,"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":["rspatial","stewart"],"created_at":"2024-08-13T07:05:51.489Z","updated_at":"2025-04-23T02:30:29.225Z","avatar_url":"https://github.com/riatelab.png","language":"R","funding_links":[],"categories":["R"],"sub_categories":[],"readme":"\n# potential \u003cimg src=\"man/figures/logo.png\" align=\"right\" width=\"140\"/\u003e\n\n[![](https://www.r-pkg.org/badges/version/potential)](https://cran.r-project.org/package=potential)\n[![R-CMD-check](https://github.com/riatelab/potential/workflows/R-CMD-check/badge.svg)](https://github.com/riatelab/potential/actions)\n[![codecov](https://codecov.io/gh/riatelab/potential/branch/master/graph/badge.svg?token=G8MZTHC9KQ)](https://app.codecov.io/gh/riatelab/potential)\n[![Project Status: Active – The project has reached a stable, usable\nstate and is being actively\ndeveloped.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)\n\nThis package provides functions to compute the potential model as\ndefined by Stewart (1941). Several options are available to customize\nthe model, for example it is possible to fine-tune the distance friction\nfunctions or to use custom distance matrices. Some computations are\nparallelized to improve their efficiency.\n\n-   [**Website**](https://riatelab.github.io/potential/)  \n-   [**Vignette**](https://riatelab.github.io/potential/articles/potential.html)  \n-   [**Blog post**](https://rgeomatic.hypotheses.org/2023)\n\n## Installation\n\nYou can install the released version of `potential` from\n[CRAN](https://CRAN.R-project.org/package=potential) with:\n\n``` r\ninstall.packages(\"potential\")\n```\n\nYou can install the development version of `potential` from GitHub with:\n\n``` r\n# install.packages(\"remotes\")\nremotes::install_github(\"riatelab/potential\")\n```\n\n## Demo\n\n``` r\nlibrary(mapsf)\nlibrary(potential)\n# Display the spatial interaction function\nplot_inter(fun = \"e\", span = 75000, beta = 2, limit = 250000)\n```\n\n![](man/figures/demox-1.png)\u003c!-- --\u003e\n\n``` r\n# create a regular grid\ny \u003c- create_grid(x = n3_poly, res = 20000)\n# compute potentials\npot \u003c- mcpotential(\n  x = n3_pt, y = y,\n  var = \"POP19\",\n  fun = \"e\", span = 75000,\n  beta = 2, limit = 250000, \n  ncl = 2\n)\n# Define potential according to the maximum value\ny$pot \u003c- pot / max(pot) * 100\n# create equipotential areas\nbks \u003c- seq(0, 100, length.out = 11)\nequipot \u003c- equipotential(y, var = \"pot\", breaks = bks, mask = n3_poly)\n# map potentials\nmf_theme(\"default\")\nmf_map(x = equipot, var = \"min\", type = \"choro\", \n       breaks = bks, \n       pal = hcl.colors(10, 'Teal'),\n       border = \"#121725\", \n       leg_val_rnd = 0,\n       lwd = .2, \n       leg_pos = \"topright\", \n       leg_title = \"Potential Intensity\")\nmf_title(txt = \"Potentials of Population\")\nmf_credits(txt = \"© EuroGeographics for the administrative boundaries and © Eurostat for data\")\n```\n\n![](man/figures/demo-1.png)\u003c!-- --\u003e\n\n## Note\n\nThis package provides access to the revamped potential-related functions\ninitially offered by\n[`SpatialPosition`](https://CRAN.R-project.org/package=SpatialPosition).\n\n## References\n\n\u003cdiv id=\"refs\" class=\"references csl-bib-body hanging-indent\"\u003e\n\n\u003cdiv id=\"ref-STEWART41\" class=\"csl-entry\"\u003e\n\nStewart, John Q. 1941. “An Inverse Distance Variation for Certain Social\nInfluences.” *Science* 93 (2404): 89–90.\n\u003chttps://doi.org/10.1126/science.93.2404.89\u003e.\n\n\u003c/div\u003e\n\n\u003c/div\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Friatelab%2Fpotential","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Friatelab%2Fpotential","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Friatelab%2Fpotential/lists"}