{"id":18012695,"url":"https://github.com/thiyangt/ceylon","last_synced_at":"2025-03-26T16:31:42.400Z","repository":{"id":129914725,"uuid":"343696463","full_name":"thiyangt/ceylon","owner":"thiyangt","description":"Plot maps of Sri Lanka","archived":false,"fork":false,"pushed_at":"2025-03-02T11:20:30.000Z","size":45888,"stargazers_count":11,"open_issues_count":0,"forks_count":2,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-03-22T02:51:20.597Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/thiyangt.png","metadata":{"files":{"readme":"README.Rmd","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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-03-02T08:18:54.000Z","updated_at":"2025-03-02T11:20:33.000Z","dependencies_parsed_at":null,"dependency_job_id":"312939ac-c99b-44f1-8e22-faf6f8d14c2d","html_url":"https://github.com/thiyangt/ceylon","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thiyangt%2Fceylon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thiyangt%2Fceylon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thiyangt%2Fceylon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thiyangt%2Fceylon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thiyangt","download_url":"https://codeload.github.com/thiyangt/ceylon/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245692704,"owners_count":20656992,"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-10-30T03:18:28.431Z","updated_at":"2025-03-26T16:31:40.554Z","avatar_url":"https://github.com/thiyangt.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# ceylon \u003ca href='https://github.com/thiyangt/covid19srilanka'\u003e\u003cimg src='man/figures/hex.png' align=\"right\"  width=\"200\"/\u003e\u003c/a\u003e\n\n\u003c!-- badges: start --\u003e\n\u003c!-- badges: end --\u003e\n\n![https://zenodo.org/badge/DOI/10.5281/zenodo.10432141.svg](https://zenodo.org/badge/DOI/10.5281/zenodo.10432141.svg)\n\n\nThe goal of ceylon is to provide data to plot maps of Sri Lanka.\n\n## Installation \n\nYou can install the development version from [GitHub](https://github.com/) with:\n\n``` r\n# install.packages(\"devtools\")\ndevtools::install_github(\"thiyangt/ceylon\")\n```\n\n## 1. Country level\n\n```{r example}\nlibrary(ceylon)\nlibrary(tidyverse)\nlibrary(sp)\nlibrary(viridis)\ndata(sf_sl_0)\nggplot(sf_sl_0) + geom_sf()\n```\n\n## 2. Provinces of Sri Lanka\n\n```{r example0}\ndata(province)\nprovince\nggplot(province) + geom_sf(mapping = aes(), show.legend = TRUE)\n```\n\n\n## 3. Districts in Sri Lanka\n\n```{r example2}\ndata(district)\nggplot(district) + geom_sf() +  scale_fill_viridis()\n```\n\n## 4. Divisional secretariats in Sri Lanka\n\n```{r example3}\ndata(sf_sl_3)\nggplot(sf_sl_3) + geom_sf()\n```\n\n## 5. Plotting river network in Sri Lanka\n\n```{r}\ndata(\"rivers\")\nggplot(data = sf_sl_0) +\n  geom_sf(fill=\"#edf8b1\", color=\"#AAAAAA\") +\n  geom_sf(data=rivers, colour=\"#253494\") +\n  labs(title =  \"Sri Lanka Rivers and Streams\")\n```\n\n## Making different types of Maps\n\n### Choropleth Map\n\n```{r}\nggplot(province) + \n  geom_sf(mapping = aes(fill = population), show.legend = TRUE) + scale_fill_viridis()\n```\n\n### Contiguous Cartogram\n\n```{r, carto}\nlibrary(cartogram)\nlibrary(sf)\nlibrary(sp)\ncont \u003c- cartogram_cont(province,\n                       weight = \"population\") |\u003e\n                      st_as_sf()\nggplot(cont) + \n  geom_sf(aes(fill = population), colour = \"white\") + scale_fill_viridis()\n```\n\n### Non-Contiguous Cartogram\n\n```{r, ncont}\nncont \u003c- cartogram_ncont(province,\n                       weight = \"population\") |\u003e\n                      st_as_sf()\nggplot(ncont) + \n  geom_sf(data = province) +\n  geom_sf(aes(fill = population), colour = \"white\") + scale_fill_viridis()\n```\n\n### Dorling Cartogram\n\n```{r, dorl}\ndorl \u003c- cartogram_dorling(province,\n                       weight = \"population\") |\u003e\n                      st_as_sf()\nggplot(dorl) + \n  geom_sf(data = province) +\n  geom_sf(aes(fill = population), colour = \"white\") + scale_fill_viridis()\n```\n\n## Cite\n\nTalagala, T. S. (2023). ceylon: Creating Maps of Sri Lanka Administrative Regions, Rivers and Streams. Zenodo. https://doi.org/10.5281/zenodo.10432141\n\n### Working paper\n\nTalagala, T. S. (2024). ceylon: An R package for plotting the maps of Sri Lanka. arXiv preprint arXiv:2401.02467.\n\n\n### Acknowledgement\n\nThis package is inspired by the talk given by [Stephanie Kobakian](https://srk.netlify.app/) at [R-Ladies Colombo meetup](https://rladiescolombo.netlify.app/talk/3_map/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthiyangt%2Fceylon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthiyangt%2Fceylon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthiyangt%2Fceylon/lists"}