{"id":18722650,"url":"https://github.com/mdsumner/freegeomsf","last_synced_at":"2025-06-15T08:36:48.300Z","repository":{"id":169993639,"uuid":"646096462","full_name":"mdsumner/freegeomsf","owner":"mdsumner","description":"Free 'geom_sf' from its Aspect Ratio Shackles","archived":false,"fork":false,"pushed_at":"2023-05-27T09:25:26.000Z","size":280,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-26T09:22:22.362Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mdsumner.png","metadata":{"files":{"readme":"README.Rmd","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2023-05-27T09:18:40.000Z","updated_at":"2025-03-22T08:13:29.000Z","dependencies_parsed_at":null,"dependency_job_id":"dcc9aa69-1499-47ad-b2a2-8014eb81ade0","html_url":"https://github.com/mdsumner/freegeomsf","commit_stats":null,"previous_names":["mdsumner/freegeomsf"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdsumner%2Ffreegeomsf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdsumner%2Ffreegeomsf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdsumner%2Ffreegeomsf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdsumner%2Ffreegeomsf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mdsumner","download_url":"https://codeload.github.com/mdsumner/freegeomsf/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248586225,"owners_count":21128995,"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":[],"created_at":"2024-11-07T13:42:20.682Z","updated_at":"2025-04-12T14:53:16.090Z","avatar_url":"https://github.com/mdsumner.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"---\noutput: github_document\n---\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n```{r, include = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  fig.path = \"man/figures/README-\",\n  out.width = \"100%\"\n)\n```\n\n# freegeomsf\n\n\u003c!-- badges: start --\u003e\n\u003c!-- badges: end --\u003e\n\nThe goal of freegeomsf is to modify sf data in order to simulate the support for free scales in facted ggplots (as if we did `+ facet_wrap(~a, scales = \"free\"))`). \n\nCurrently we only support a single option, to rescale every geom to its own unit square. Other variants are possible (x vs y, grouped scales, etc). \n\n## Installation\n\nYou can install the development version of freegeomsf like so:\n\n``` r\n# install.packages(\"pak\")\npak::pak(\"mdsumner/freegeomsf\")\n```\n\n## Example\n\nThis is a basic example which shows how to plot some polygons of a New Zealand\ndata set separately as facets. \n\n```{r example}\nlibrary(freegeomsf)\n\nlibrary(ggplot2)\nggplot(freegeomsf(sfx[1:12, ])) + geom_sf() + facet_wrap(~a) + \n   theme(axis.title.x=element_blank(),\n        axis.text.x=element_blank(),\n        axis.ticks.x=element_blank(), \n        \n        axis.title.y=element_blank(),\n        axis.text.y=element_blank(),\n        axis.ticks.y=element_blank())\n\n```\n\nThis would be a completely pointless plot if we faceted with the original data \nbecause we can't control the scales in the usual ways. \n\n(Sometimes we want to see what polygons look like relative to other polygons, other options IYI involve cowplot or patchwork but this approach was sufficient here). \n\nA less verbose way to remove axis labels wbg. \n\nNote that the axes are unrealistic here because we can only *simulate* free scales by modifying the data. This kind of plot is essential for some work, but it would be nice to keep the reality of the axes too but we can't. \n\n(We could of course decompose the data and use geom_polygon, but there's a lot of details to worry about and this was easier just to get on with the work required). \n\n## Motivation\n\nThis was motivated by the need for a simple plot requirement so we could see the relationship between polygons in detail. Sometimes you can't tell what polygons are holes in what other polygons, and this is obviously a useful thing to be able to indicate in environmental protection and management scenarios. \n\nThe idea was originally noted here: https://gist.github.com/mdsumner/7b354f73b47ccb67861ff0363cdbb3d3\n\n\nIn other aspirations this might become a set of helpers for shift, scale, rotate for geometries that aren't just one format. \n\n## Code of Conduct\n  \nPlease note that the freegeomsf project is released with a [Contributor Code of Conduct](https://contributor-covenant.org/version/2/1/CODE_OF_CONDUCT.html). By contributing to this project, you agree to abide by its terms.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmdsumner%2Ffreegeomsf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmdsumner%2Ffreegeomsf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmdsumner%2Ffreegeomsf/lists"}