{"id":17250593,"url":"https://github.com/loreabad6/ggraph-spatial-examples","last_synced_at":"2026-01-05T23:06:28.323Z","repository":{"id":117983508,"uuid":"332523098","full_name":"loreabad6/ggraph-spatial-examples","owner":"loreabad6","description":null,"archived":false,"fork":false,"pushed_at":"2021-03-05T16:38:09.000Z","size":12517,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-24T07:53:54.211Z","etag":null,"topics":["graph-representations","spatial-network-visualizations"],"latest_commit_sha":null,"homepage":"","language":"HTML","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/loreabad6.png","metadata":{"files":{"readme":"README.Rmd","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-01-24T18:22:17.000Z","updated_at":"2024-06-27T07:33:34.000Z","dependencies_parsed_at":"2024-08-12T14:30:23.128Z","dependency_job_id":null,"html_url":"https://github.com/loreabad6/ggraph-spatial-examples","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/loreabad6%2Fggraph-spatial-examples","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loreabad6%2Fggraph-spatial-examples/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loreabad6%2Fggraph-spatial-examples/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loreabad6%2Fggraph-spatial-examples/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/loreabad6","download_url":"https://codeload.github.com/loreabad6/ggraph-spatial-examples/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245605709,"owners_count":20643030,"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":["graph-representations","spatial-network-visualizations"],"created_at":"2024-10-15T06:49:05.189Z","updated_at":"2026-01-05T23:06:28.190Z","avatar_url":"https://github.com/loreabad6.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"---\ntitle: \"Geospatial Network Visualizations using `ggraph`\"\nauthor: \"Lorena Abad\"\noutput: github_document\n---\n\n```{r setup, include=FALSE}\nknitr::opts_chunk$set(echo = TRUE)\n```\n\nShowcasing the possibilities of using `ggraph` with a layout that understands geographical space positions via `sf`. These examples use `sfnetworks` and my implementation of `ggraph` still under construction before a PR is possible, and can be installed as:\n\n```{r, eval = F}\nremotes::install_github(\"loreabad6/ggraph\")\n```\n\n## Showcase\n\n### Break Free from Plastic\nThe data used here comes from the [Tidy Tuesday](https://github.com/rfordatascience/tidytuesday) weekly data project. This is week 5 of 2021 were we analyzed data from the \"Break Free from Plastic\" initiative. Have a look at the final plot:\n\n![](https://raw.githubusercontent.com/loreabad6/TidyTuesday/master/plot/2021_week_05.png)\n\nHere is a [step by step guide](https://github.com/loreabad6/TidyTuesday/blob/master/R/2021/week_05.md) on how to recreate it.\n\n### Airports in the U.S.\n\nThis example is inspired on this [wonderful blogpost on Network Visualization](https://kateto.net/sunbelt2019#overlaying-networks-on-geographic-maps) by Katherine Ognyanova, where I tried to recreate the last plot. \n\n![](figs/us_airports.png)\n\nCode [here](code/airports.R).\n\n### The fourth way of visualizing a graph on a map\n\nIn his [very helpful blogpost](https://datascience.blog.wzb.eu/2018/05/31/three-ways-of-visualizing-a-graph-on-a-map/) Markus Neteler (@internaut) guides us through three different ways to plot a spatial graph on a map. With the `ggraph` and `sfnetworks` combination, we can add a fourth way!\n\n![](figs/graph_on_a_map.png)\n\nCode [here](code/graph-on-a-map.R).\n\n### {sfnetworks} showcase\n\nExamples of what can be done with the `sfnetworks` package is shown here, with all the figures created with `ggraph` and `ggplot2`! \n\n![](figs/sfnetworks-showcase.gif)\n\nTo create this GIF I used `xaringan` and you can find the raw [`.Rmd` file here](code/sfnetworks-showcase/index.Rmd)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Floreabad6%2Fggraph-spatial-examples","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Floreabad6%2Fggraph-spatial-examples","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Floreabad6%2Fggraph-spatial-examples/lists"}