{"id":21881687,"url":"https://github.com/r-barnes/dggridr","last_synced_at":"2026-01-18T21:00:47.403Z","repository":{"id":9676365,"uuid":"62900874","full_name":"r-barnes/dggridR","owner":"r-barnes","description":"Discrete Global Grids for R: Spatial Analysis Done Right","archived":false,"fork":false,"pushed_at":"2024-09-30T20:07:46.000Z","size":3010,"stargazers_count":184,"open_issues_count":12,"forks_count":22,"subscribers_count":18,"default_branch":"master","last_synced_at":"2026-01-11T22:32:51.960Z","etag":null,"topics":["discrete-global-grids","geospatial","r","spatial-analysis"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/r-barnes.png","metadata":{"files":{"readme":"README.md","changelog":"NEWS","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","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":"2016-07-08T16:05:10.000Z","updated_at":"2025-11-21T15:21:52.000Z","dependencies_parsed_at":"2023-02-13T22:45:16.732Z","dependency_job_id":"ac80f8e4-739b-49f8-ab8b-19c22b37e5f6","html_url":"https://github.com/r-barnes/dggridR","commit_stats":{"total_commits":367,"total_committers":4,"mean_commits":91.75,"dds":"0.019073569482288777","last_synced_commit":"2d7be861e5f243c6910e539041c9cbcf00b35068"},"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"purl":"pkg:github/r-barnes/dggridR","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r-barnes%2FdggridR","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r-barnes%2FdggridR/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r-barnes%2FdggridR/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r-barnes%2FdggridR/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/r-barnes","download_url":"https://codeload.github.com/r-barnes/dggridR/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r-barnes%2FdggridR/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28550464,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-18T20:59:07.572Z","status":"ssl_error","status_checked_at":"2026-01-18T20:59:02.799Z","response_time":98,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["discrete-global-grids","geospatial","r","spatial-analysis"],"created_at":"2024-11-28T09:19:58.036Z","updated_at":"2026-01-18T21:00:47.378Z","avatar_url":"https://github.com/r-barnes.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![dggridR status badge](https://fastverse.r-universe.dev/badges/dggridR)](https://fastverse.r-universe.dev/dggridR)\n[![CRAN status](https://www.r-pkg.org/badges/version/dggridR)](https://cran.r-project.org/package=dggridR) \n[![cran checks](https://badges.cranchecks.info/worst/dggridR.svg)](https://cran.r-project.org/web/checks/check_results_dggridR.html)\n![downloads per month](https://cranlogs.r-pkg.org/badges/dggridR) \u003c!-- ?color=blue --\u003e\n![downloads](https://cranlogs.r-pkg.org/badges/grand-total/dggridR) \u003c!-- ?color=blue --\u003e\n[![dependencies](https://tinyverse.netlify.app/badge/dggridR)](https://CRAN.R-project.org/package=dggridR)\n[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.1322866.svg)](https://doi.org/10.5281/zenodo.1322866)\n\ndggridR: Discrete Global Grids for R\n====================================\n\n_Spatial Analysis Done Right_\n\nYou want to do spatial statistics, and it's going to involve binning.\n\nBinning with a rectangular grid introduces messy distortions. At the macro-scale\nusing a rectangular grid does things like making Greenland bigger than the\nUnited States and Antarctica the largest continent.\n\n![Mercator Projection](vignettes/mercator.png)\n\nBut this kind of distortion is present no matter what the resolution is; in\nfact, it shows up whenever you project a sphere onto a plane.\n\nWhat you want are bins of equal size, regardless of where they are on the globe,\nregardless of their resolution.\n\ndggridR solves this problem.\n\ndggridR builds discrete global grids which partition the surface of the Earth\ninto hexagonal, triangular, or diamond cells, **all of which have the same\nsize.** (There are some minor caveats which are detailed in the vignettes.)\n\n![Discrete Global Grid in use](vignettes/dggrid.png)\n\n(Naturally, you can use _much_ smaller cells than those shown in the image above.)\n\nThis package includes everything you need to make spatial binning great again.\n\nMany details and examples are included in the vignette.\n\n\nInstallation\n------------\n\ndggridR is available from CRAN via:\n\n    install.packages('dggridR')\n\nIf you want your code to be as up-to-date as possible, you can install it using:\n\n    install.packages('dggridR', repos = 'https://fastverse.r-universe.dev')\n\nShow me some code\n-----------------\n\nOkay.\n\nYour analysis could be as easy as this:\n\n```R\nlibrary(dggridR)\nlibrary(collapse)\n\n#Construct a global grid with cells approximately 1000 miles across\ndggs          \u003c- dgconstruct(spacing=1000, metric=FALSE, resround='down')\n\n#Load included test data set\ndata(dgquakes)\n\n#Get the corresponding grid cells for each earthquake epicenter (lat-long pair)\ndgquakes$cell \u003c- dgGEO_to_SEQNUM(dggs, dgquakes$lon, dgquakes$lat)$seqnum\n\n#Get the number of earthquakes in each equally-sized cell\nquakecounts   \u003c- dgquakes |\u003e fcount(cell)\n```\n\nShow me more examples!\n----------------------\n\nIn R, typing\n\n    vignette('dggridR')\n\nwill bring up many examples.\n\n\nBut I want higher resolution grids than that\n--------------------------------------------\n\nMany different grid resolutions are available for many different grids. The\nfollowing chart shows the number of cells, their area, and statistics regarding\nthe spacing of their center nodes for the ISEA3H grid type.\n\n|Res |Number of Cells  | Cell Area (km^2) |    Min      |     Max     |    Mean     |    Std    |\n|---:|----------------:|-----------------:|------------:|------------:|------------:|----------:|\n|  1 |              32 | 17,002,187.39080 | 4,156.18000 | 4,649.10000 | 4,320.49000 | 233.01400 |\n|  2 |              92 |  5,667,395.79693 | 2,324.81000 | 2,692.72000 | 2,539.69000 | 139.33400 |\n|  3 |             272 |  1,889,131.93231 | 1,363.56000 | 1,652.27000 | 1,480.02000 |  89.39030 |\n|  4 |             812 |    629,710.64410 |   756.96100 |   914.27200 |   855.41900 |  52.14810 |\n|  5 |           2,432 |    209,903.54803 |   453.74800 |   559.23900 |   494.95900 |  29.81910 |\n|  6 |           7,292 |     69,967.84934 |   248.80400 |   310.69300 |   285.65200 |  17.84470 |\n|  7 |          21,872 |     23,322.61645 |   151.22100 |   187.55000 |   165.05800 |   9.98178 |\n|  8 |          65,612 |      7,774.20548 |    82.31100 |   104.47000 |    95.26360 |   6.00035 |\n|  9 |         196,832 |      2,591.40183 |    50.40600 |    63.00970 |    55.02260 |   3.33072 |\n| 10 |         590,492 |        863.80061 |    27.33230 |    35.01970 |    31.75960 |   2.00618 |\n| 11 |       1,771,472 |        287.93354 |    16.80190 |    21.09020 |    18.34100 |   1.11045 |\n| 12 |       5,314,412 |         95.97785 |     9.09368 |    11.70610 |    10.58710 |   0.66942 |\n| 13 |      15,943,232 |         31.99262 |     5.60065 |     7.04462 |     6.11367 |   0.37016 |\n| 14 |      47,829,692 |         10.66421 |     3.02847 |     3.90742 |     3.52911 |   0.22322 |\n| 15 |     143,489,072 |          3.55473 |     1.86688 |     2.35058 |     2.03789 |   0.12339 |\n| 16 |     430,467,212 |          1.18491 |     1.00904 |     1.30335 |     1.17638 |   0.07442 |\n| 17 |   1,291,401,632 |          0.39497 |     0.62229 |     0.78391 |     0.67930 |   0.04113 |\n| 18 |   3,874,204,892 |          0.13166 |     0.33628 |     0.43459 |     0.39213 |   0.02481 |\n| 19 |  11,622,614,672 |          0.04389 |     0.20743 |     0.26137 |     0.22643 |   0.01371 |\n| 20 |  34,867,844,012 |          0.01463 |     0.11208 |     0.14489 |     0.13071 |   0.00827 |\n\n\n\nCredits\n-------\n\nThe code in the 'src' directory is based off of\n[DGGRIDv6.2b](https://discreteglobal.wpengine.com/) by Kevin Sahr.\n\nHowever, Richard Barnes has made some significant alterations. These include:\n\n* Replacement of gpclib with clipper, thus making DGGRID into FLOSS software\n  available for both commercial and non-commercial use without restriction\n* Restructuring and simplifying all of the makefiles to enable compilation in R\n* Direct inclusion of the shapelib library\n* Addition of the SEQTOPOLY option under the GENERATE_GRID faculty\n* Alterations that enable the code to be compiled under GCC6\n* Alterations that make the code ISO C conformant\n* Alterations to resolve -pedantic and -Wall warnings\n\nThe package relies on several libraries, as noted in the **Licensing** section\nbelow.\n\n\n\nLicensing\n---------\n\nThis package uses the following libraries:\n\n * clipper:  The clipper library has been released under the Boostv1 license by\n             Angus Johnson\n\n * dggrid:   Kevin Sahr has released dggrid as a\n             \"public domain software program\"\n\n * proj4lib: Gerald Evenden has released this code into the public domain. More\n             recent versions of the library, not used here, are under an\n             MIT-style license.\n\n * shapelib: Frank Warmerdam has released shapelib under an MIT-style license.\n             There is also an LGPL licensing option which I have chosen not to\n             use.\n\nThis package, and all code and documentation not otherwise mentioned above\n(essentially anything outside the `src/` directory of this package) are released\nunder the MIT (Expat) license, as stated in the `LICENSE` file. The `LICENCE`\nfile exists for use with CRAN.\n\n\n\nDisclaimer\n----------\n\nThis package *should* operate in the manner described here, in the package's\nmain documentation, and in Kevin Sahr's `dggrid` documentation. Unfortunately,\nnone of us are paid enough to make absolutely, doggone certain that that's the\ncase. That said, if you find bugs or are seeking enhancements, we want to hear\nabout them.\n\n\n\nCiting this Package\n-------------------\n\nPlease cite this package as:\n\n \u003e Richard Barnes and Kevin Sahr (2017). dggridR: Discrete Global Grids for R. R package version 2.0.4. \"https://github.com/r-barnes/dggridR/\" doi:10.5281/zenodo.1322866\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fr-barnes%2Fdggridr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fr-barnes%2Fdggridr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fr-barnes%2Fdggridr/lists"}