{"id":32200343,"url":"https://github.com/pfizer-opensource/deprivater","last_synced_at":"2026-02-19T08:35:11.695Z","repository":{"id":247634745,"uuid":"821483298","full_name":"pfizer-opensource/deprivateR","owner":"pfizer-opensource","description":"Tools for calculating and visualizing measures of deprivation for social determinants of health research in the United States (R package)","archived":false,"fork":false,"pushed_at":"2025-02-04T19:41:12.000Z","size":3681,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-22T03:45:54.199Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://pfizer-opensource.github.io/deprivateR/","language":"R","has_issues":false,"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":null,"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}},"created_at":"2024-06-28T16:35:10.000Z","updated_at":"2025-03-01T07:20:15.000Z","dependencies_parsed_at":"2025-01-22T22:31:40.393Z","dependency_job_id":null,"html_url":"https://github.com/pfizer-opensource/deprivateR","commit_stats":null,"previous_names":["pfizer-opensource/deprivater"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/pfizer-opensource/deprivateR","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pfizer-opensource%2FdeprivateR","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pfizer-opensource%2FdeprivateR/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pfizer-opensource%2FdeprivateR/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pfizer-opensource%2FdeprivateR/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pfizer-opensource","download_url":"https://codeload.github.com/pfizer-opensource/deprivateR/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pfizer-opensource%2FdeprivateR/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280376534,"owners_count":26320276,"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","status":"online","status_checked_at":"2025-10-22T02:00:06.515Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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:46:16.584Z","updated_at":"2025-10-22T03:46:18.167Z","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# deprivateR\n\n[![R build status](https://github.com/pfizer-opensource/deprivateR/workflows/R-CMD-check/badge.svg)](https://github.com/pfizer-opensource/deprivateR/actions)\n[![CRAN_status_badge](https://www.r-pkg.org/badges/version/deprivateR)](https://cran.r-project.org/package=deprivateR)\n[![cranchecks](https://badges.cranchecks.info/worst/deprivateR.svg)](https://cran.r-project.org/web/checks/check_results_deprivateR.html)\n[![Downloads](https://cranlogs.r-pkg.org/badges/deprivateR?color=brightgreen)](https://www.r-pkg.org/pkg/deprivateR)\n[![DOI](https://img.shields.io/badge/DOI-10.32614%2FCRAN.package.deprivateR-blue)](https://doi.org/10.32614/deprivateR)\n\n`deprivateR` is meant to provide a unified API for accessing and calculating a number of different measures of socioeconomic deprivation in the United States, including the Area Deprivation Index (ADI), Neighborhood Deprivation Index (NDI), and the Social Vulnerability Index. The Gini Coefficient can also be returned, though it is not re-calculated on the fly. \n\n## Motivation\nThe [`sociome`](https://CRAN.R-project.org/package=sociome) and [`ndi`](https://CRAN.R-project.org/package=ndi) packages are excellent contributions, but offer different APIs for returning their respective indices. `deprivateR` provides a unified interface for accessing these measures of deprivation, as well as the ability to calculate the various forms of the Social Vulnerability Index (SVI) that the Centers for Disease Control and Prevention (CDC) has published. Importantly, SVI can be calculated for a variety of years and geographic levels. This functionality expands the possibilities for implementing these measures in research and public health practice. However, users should also be aware that ADI, NDI, and SVI have not been extensively validated for some Census geographies.\n\n## Installation\nThe easiest way to install `deprivateR` is from CRAN:\n\n```r\ninstall.packages(\"deprivateR\")\n```\n\nAlternatively, you can install development version of `deprivateR` from GitHub with `remotes`:\n\n```r\n# install.packages(\"remotes\")\nremotes::install_github(\"pfizer-opensource/deprivateR\")\n```\n\n## Usage\n### Calculate Deprivation Indices\nThe core function in `deprivateR` is `dep_get_index()`. This function returns the specified index for the given geography and year:\n\n```r\n\u003e dep_get_index(geography = \"county\", state = \"MO\", index = \"adi\", year = 2022)\nUsing FIPS code '29' for state 'MO'\n# A tibble: 115 × 3\n   GEOID NAME                         ADI\n   \u003cchr\u003e \u003cchr\u003e                      \u003cdbl\u003e\n 1 29001 Adair County, Missouri     101. \n 2 29003 Andrew County, Missouri     69.4\n 3 29005 Atchison County, Missouri  104. \n 4 29007 Audrain County, Missouri   115. \n 5 29009 Barry County, Missouri     106. \n 6 29011 Barton County, Missouri    118. \n 7 29013 Bates County, Missouri     107. \n 8 29015 Benton County, Missouri    103. \n 9 29017 Bollinger County, Missouri 104. \n10 29019 Boone County, Missouri      68.9\n# ℹ 105 more rows\n# ℹ Use `print(n = ...)` to see more rows\n```\n\nThe `index` argument can take multiple indicies at once, as can the `year` argument. This gives users the ability to compare multiple indicies across multiple years:\n\n```r\n\u003e dep_get_index(geography = \"county\", state = \"MO\", index = c(\"svi20\", \"svi20s\"), year = c(2021, 2022))\nUsing FIPS code '29' for state 'MO'\n# A tibble: 230 × 5\n   GEOID NAME                       YEAR SVI_20 SVI_20S\n   \u003cchr\u003e \u003cchr\u003e                     \u003cdbl\u003e  \u003cdbl\u003e   \u003cdbl\u003e\n 1 29001 Adair County, Missouri     2021  0.377   0.386\n 2 29001 Adair County, Missouri     2022  0.456   0.439\n 3 29003 Andrew County, Missouri    2021  0       0    \n 4 29003 Andrew County, Missouri    2022  0       0    \n 5 29005 Atchison County, Missouri  2021  0.149   0.167\n 6 29005 Atchison County, Missouri  2022  0.149   0.167\n 7 29007 Audrain County, Missouri   2021  0.746   0.781\n 8 29007 Audrain County, Missouri   2022  0.886   0.904\n 9 29009 Barry County, Missouri     2021  0.702   0.693\n10 29009 Barry County, Missouri     2022  0.702   0.667\n# ℹ 220 more rows\n# ℹ Use `print(n = ...)` to see more rows\n```\n\nAn alternative to `dep_get_index()` is `dep_calc_index()`, which provides users with the ability to calculate indicies using pre-downloaded data. The `dep_sample_data()` function can be used to explore how this function works using sample data from the 2018-2022 5-year American Community Survey for Missouri Counties:\n\n```r\n\u003e ndi_m \u003c- dep_sample_data(index = \"ndi_m\")\n\u003e dep_calc_index(ndi_m, geography = \"county\", index = \"ndi_m\", year = 2022)\nWarning: The proportion of variance explained by PC1 is less than 0.50.\n# A tibble: 115 × 4\n   GEOID NAME                        YEAR   NDI_M\n   \u003cchr\u003e \u003cchr\u003e                      \u003cdbl\u003e   \u003cdbl\u003e\n 1 29001 Adair County, Missouri      2022  0.0193\n 2 29003 Andrew County, Missouri     2022 -0.108 \n 3 29005 Atchison County, Missouri   2022 -0.0505\n 4 29007 Audrain County, Missouri    2022  0.0107\n 5 29009 Barry County, Missouri      2022  0.0129\n 6 29011 Barton County, Missouri     2022  0.105 \n 7 29013 Bates County, Missouri      2022  0.0679\n 8 29015 Benton County, Missouri     2022  0.0283\n 9 29017 Bollinger County, Missouri  2022  0.0565\n10 29019 Boone County, Missouri      2022 -0.0646\n# ℹ 105 more rows\n# ℹ Use `print(n = ...)` to see more rows\n```\n\n### Additional Functionality\nThe `deprivateR` package also contains a number of helper functions that we use in our disparities work. These include:\n\n  * `dep_percentiles()`: Calculate percentiles for a given variable in a data frame. This is the method used to reproduce SVI estimates, which include percentiles for each variable. It is also the method used for `dep_get_index()` and `dep_calc_index()` when `return_percentiles = TRUE`.\n  * `dep_quantiles()`: Calculate quantiles for a given variable in a data frame. We use this to create tertiles and quartiles for descriptive statistics and regression analyses.\n  * `dep_map_breaks()`: Calculate map breaks for a given variable in a data frame. This is useful for creating choropleth maps with package like `ggplot2` or `leaflet`. It can be used to create \"bins\" automatically, using any of the algorithms supported by \\code{classInt::classIntervals()}, or accept pre-specified breaks. \n\n## Gratitude\n`deprivateR` would not be possible without the work of the [`sociome`](https://CRAN.R-project.org/package=sociome) and [`ndi`](https://CRAN.R-project.org/package=ndi) packages. The `sociome` package's development was led by Nik Krieger, and the `ndi` package's author is Ian D. Buller - we're immensely grateful for their contributions to the field. Likewise, `deprivateR` 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 U.S. Census Bureau data for calculating these indices.\n\n## Feedback and Code of Conduct\nIf you have feedback on `deprivateR`, please [open an issue on GitHub](https://github.com/pfizer-opensource/deprivateR/issues) after checking the [contribution guidelines](https://github.com/pfizer-opensource/deprivateR/blob/main/.github/CONTRIBUTING.md). Please note that this project is released with a Contributor [Code of Conduct](https://github.com/pfizer-opensource/deprivateR/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%2Fdeprivater","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpfizer-opensource%2Fdeprivater","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpfizer-opensource%2Fdeprivater/lists"}