{"id":32200041,"url":"https://github.com/pfizer-opensource/zipper","last_synced_at":"2026-02-22T19:04:47.173Z","repository":{"id":247137005,"uuid":"821482997","full_name":"pfizer-opensource/zippeR","owner":"pfizer-opensource","description":"Tools for Working with ZIP Codes, ZCTAs, and 3-digit ZCTAs (R package)","archived":false,"fork":false,"pushed_at":"2025-05-03T01:31:29.000Z","size":4303,"stargazers_count":12,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-29T05:57:53.247Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://pfizer-opensource.github.io/zippeR/","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pfizer-opensource.png","metadata":{"files":{"readme":"README.Rmd","changelog":"NEWS.md","contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":".github/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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-06-28T16:34:15.000Z","updated_at":"2025-05-03T01:21:30.000Z","dependencies_parsed_at":"2025-02-03T19:22:03.707Z","dependency_job_id":"3beb2c04-8f78-4740-82ca-752335ed4fde","html_url":"https://github.com/pfizer-opensource/zippeR","commit_stats":null,"previous_names":["pfizer-opensource/zipper"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/pfizer-opensource/zippeR","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pfizer-opensource%2FzippeR","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pfizer-opensource%2FzippeR/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pfizer-opensource%2FzippeR/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pfizer-opensource%2FzippeR/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pfizer-opensource","download_url":"https://codeload.github.com/pfizer-opensource/zippeR/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pfizer-opensource%2FzippeR/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29723574,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-22T15:10:41.462Z","status":"ssl_error","status_checked_at":"2026-02-22T15:10:04.636Z","response_time":110,"last_error":"SSL_read: 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":[],"created_at":"2025-10-22T03:36:26.421Z","updated_at":"2026-02-22T19:04:47.166Z","avatar_url":"https://github.com/pfizer-opensource.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 setup, 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# zippeR\n\n[![R build status](https://github.com/pfizer-opensource/zippeR/workflows/R-CMD-check/badge.svg)](https://github.com/pfizer-opensource/zippeR/actions)\n[![CRAN_status_badge](https://www.r-pkg.org/badges/version/zippeR)](https://cran.r-project.org/package=zippeR)\n[![cranchecks](https://badges.cranchecks.info/worst/zippeR.svg)](https://cran.r-project.org/web/checks/check_results_zippeR.html)\n[![Downloads](https://cranlogs.r-pkg.org/badges/zippeR?color=brightgreen)](https://www.r-pkg.org/pkg/zippeR)\n[![DOI](https://img.shields.io/badge/DOI-10.32614%2FCRAN.package.zippeR-blue)](https://doi.org/10.32614/CRAN.package.zippeR)\n\n## Motivation\n`zippeR` provides a set of functions for working with ZIP Codes and ZCTAs as well as building spatial and demographic data for three-digit ZCTAs. These three-digit ZCTAs have limitations (they are large regions), but they are also used within American health care to protect patient confidentiality. `zippeR` therefore offers researchers who must use three-digit ZCTAs the capability to download geometric data and also aggregate demographic data from five-digit ZCTAs to three-digit ZCTAs. In addition, `zippeR` includes functions for validating and formatting vectors of ZIP Codes or ZCTAs as well as tools for cross-walking ZIP codes with ZCTAs.\n\n## Installation\nThe easiest way to get started with `zippeR` is to install it from CRAN:\n\n```r\ninstall.packages(\"zippeR\")\n```\n\nThe development version of `zippeR` can be accessed from GitHub with `remotes`:\n\n```r\n# install.packages(\"remotes\")\nremotes::install_github(\"pfizer-opensource/zippeR\")\n```\n\n## Usage\n`zippeR` contains functions that support the following tasks:\n  * Labeling five-digit and three-digit ZIP Codes\n  * Converting ZIP Codes to ZCTAs, counties, and other Census geographies\n  * Downloading ZCTA geometries for both five-digit and three-digit areas\n  * Aggregating demographic data from five-digit ZCTAs to three-digit ZCTAs\n\nWhile a quick overview of the the core functionality is below, see the vignettes and our package website for more information on how to use these functions.\n\n### Converting ZIP Codes to ZCTAs\nThe `zi_load_crosswalk()` function provides access to the former UDS Mapper project's ZIP Code to ZCTA crosswalk. This function returns a data frame with ZIP Codes and their corresponding ZCTAs. \n\n```r\n\u003e zi_load_crosswalk(year = 2020)\n# A tibble: 41,096 × 6                                                                                                                                                                                 \n   ZIP   PO_NAME    STATE ZIP_TYPE                             ZCTA  zip_join_type       \n   \u003cchr\u003e \u003cchr\u003e      \u003cchr\u003e \u003cchr\u003e                                \u003cchr\u003e \u003cchr\u003e               \n 1 00501 Holtsville NY    Post Office or large volume customer 11742 Spatial join to ZCTA\n 2 00544 Holtsville NY    Post Office or large volume customer 11742 Spatial join to ZCTA\n 3 00601 Adjuntas   PR    ZIP Code Area                        00601 ZIP Matches ZCTA    \n 4 00602 Aguada     PR    ZIP Code Area                        00602 ZIP Matches ZCTA    \n 5 00603 Aguadilla  PR    ZIP Code Area                        00603 ZIP Matches ZCTA    \n 6 00604 Aguadilla  PR    Post Office or large volume customer 00603 Spatial join to ZCTA\n 7 00605 Aguadilla  PR    Post Office or large volume customer 00603 Spatial join to ZCTA\n 8 00606 Maricao    PR    ZIP Code Area                        00606 ZIP Matches ZCTA    \n 9 00610 Anasco     PR    ZIP Code Area                        00610 ZIP Matches ZCTA    \n10 00611 Angeles    PR    Post Office or large volume customer 00641 Spatial join to ZCTA\n# … with 41,086 more rows\n```\n\nLikewise, users can use the `zip_load_crosswalk()` function combined with a HUD API key to access the HUD USPS ZIP Code Crosswalk. This function returns a data frame with ZIP Codes and their corresponding Census geographies:\n\n```r\nzi_load_crosswalk(zip_source = \"HUD\", year = 2023, qtr = 1, target = \"COUNTY\",\n  query = \"63139\", key = \"\u003cPASTE KEY\u003e\")\n    ZIP GEOID RES_RATIO BUS_RATIO OTH_RATIO TOT_RATIO        CITY STATE\n1 63139 29510         1         1         1         1 SAINT LOUIS    MO\n```\n\n### Downloading ZCTA Geometries\nThe `zi_get_geometry()` function provides access to both five and three-digit ZCTA geometries. This function returns a `sf` object with the geometries of the requested ZCTAs:\n\n```r\nmo_zcta5 \u003c- zi_get_geometry(year = 2012, state = \"MO\", method = \"centroid\", \n    includes = c(\"51640\", \"52542\", \"52573\", \"52626\"))\n```\n\n### Downloading ZCTA Demographic Data\nThe `zi_get_demographics()` function provides access to demographic data for five-digit ZCTAs. This function returns a data frame with demographic data for the requested ZCTAs:\n\n```r\nmo_gini12 \u003c- zi_get_demographics(year = 2012, table = \"B19083\", \n  survey = \"acs5\", zcta = mo_zcta5$GEOID)\n```\n\n### Aggregating Demographic Data to Three-digit ZCTAs\nThese same functions can be combined with `zi_aggregate()` to download geometric and demographic data, and then aggregate the demographic data to the three-digit ZCTA level:\n\n```r\n## download Missouri geometric data\nmo_zcta3 \u003c- zi_get_geometry(year = 2020, style = \"zcta3\", state = \"MO\",\n  territory = NULL, method = \"intersect\")\n\n## download nationwide demographic data\nmo_pop20 \u003c- zi_get_demographics(year = 2020, variables = \"B01003_001\", \n  survey = \"acs5\")\n\n## aggregate demographic data to three-digit ZCTAs\nmo_pop20 \u003c- zi_aggregate(mo_pop20, year = 2020, extensive = \"B01003_001\", \n  survey = \"acs5\", zcta = mo_zcta3$ZCTA3)\n```\n\n## Gratitude\n`zippeR` would not be possible without [Kyle Walker's](https://walker-data.com) packages [`tigris`](https://CRAN.R-project.org/package=tigris) and [`tidycensus`](https://walker-data.com/tidycensus/), which provide access to the underlying data U.S. Census Bureau data this package leverages.\n\n## Feedback and Code of Conduct\nIf you have feedback on `zippeR`, please [open an issue on GitHub](https://github.com/pfizer-opensource/zippeR/issues) after checking the [contribution guidelines](https://github.com/pfizer-opensource/zippeR/blob/main/.github/CONTRIBUTING.md). Please note that this project is released with a Contributor [Code of Conduct](https://github.com/pfizer-opensource/zippeR/blob/main/.github/CODE_OF_CONDUCT.md). By participating in this project you agree to abide by its terms.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpfizer-opensource%2Fzipper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpfizer-opensource%2Fzipper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpfizer-opensource%2Fzipper/lists"}