Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge branch:main into branch:dev_atkinson #18

Merged
merged 31 commits into from
Aug 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
15d8c6b
Fix faulty join args
DavisVaughan Dec 15, 2022
9ecc46e
Merge pull request #7 from DavisVaughan/fix/left-join-args
idblr Dec 15, 2022
76f599b
Merge branch 'dev_atkinson'
idblr Jan 19, 2023
3bb6a0b
Initial commit for branch "dev_bell_white" (ndi v0.1.4.9002)
idblr Jan 19, 2023
c11891d
Initial commit for branch "dev_bemanian_beyer" (ndi v0.1.4.9003)
idblr Jan 26, 2023
595aa28
Updated documentation
idblr Jan 30, 2023
ad1a842
Preparation for CRAN v0.1.4 release
idblr Feb 1, 2023
39cd672
Updated citation style for CITATION file
idblr Feb 1, 2023
e95311c
Preparation for CRAN v0.1.5 release
idblr Jan 23, 2024
4264722
Update R-CMD-check.yaml
idblr Jul 4, 2024
e14c17b
Initial commit for branch "dev_hoover" (ndi v0.1.6.9000)
idblr Jul 6, 2024
07c4628
:bug: Fixed bug in `bell()`, `bemanian_beyer()`, `duncan()`, `sudano(…
idblr Jul 6, 2024
f0346d9
:truck: * Replaced 'package.R' with 'ndi-package.R'
idblr Jul 6, 2024
4f60480
:art: Re-formatted code and documentation throughout
idblr Jul 6, 2024
036efc7
:memo: Updated documentation for ndi v0.1.6.9000
idblr Jul 6, 2024
bd92050
:memo: Additional formatting of README examples
idblr Jul 6, 2024
8462005
:memo: Additional formatting of README examples
idblr Jul 6, 2024
454c641
Merge pull request #9 from idblr/dev_hoover
idblr Jul 6, 2024
29f2d63
:stethoscope: Set up R-hub v2
idblr Jul 6, 2024
d312cb8
Merge branch 'main' of https://github.com/idblr/ndi
idblr Jul 6, 2024
7b07287
:stethoscope: Update R CMD check in GitHub Actions
idblr Jul 9, 2024
6afc663
Merge branch 'main' into dev_hoover
idblr Jul 9, 2024
2158d77
🔀 Merge `branch:dev_hoover` into `branch:main` #10
idblr Jul 9, 2024
12a7742
:stethoscope: Update R CMD check in GitHub Actions
idblr Jul 9, 2024
de41436
Merge branch 'dev_hoover' of https://github.com/idblr/ndi into dev_ho…
idblr Jul 9, 2024
4abfaf0
🔀 Merge `branch:dev_hoover` into `branch:main` #11
idblr Jul 9, 2024
8cdfc49
🔀 Merge `branch:dev_hoover` into `branch:main` (#12)
idblr Jul 10, 2024
081b2a1
🔀 Merge `branch:dev_hoover` into `branch:main` (#14)
idblr Aug 19, 2024
4a4147c
🔀 Merge `branch:dev_hoover` into `branch:main` (#15)
idblr Aug 20, 2024
50ba11c
🔀 Merge `branch:dev_white_blau` into `branch:main` (#16)
idblr Aug 20, 2024
2828b07
🔀 Merge `branch:dev_lieberson` into `branch:main` (#17)
idblr Aug 23, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 70 additions & 17 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: [main, master]
branches:
- main
pull_request:
branches: [main, master]
branches:
- main

name: R-CMD-check

Expand All @@ -18,32 +18,85 @@ jobs:
fail-fast: false
matrix:
config:
- {os: macos-latest, r: 'release'}
# - {os: macOS-latest, r: 'devel'} # Issue with loading 'units' dependency
- {os: macOS-latest, r: 'release'}
- {os: macOS-latest, r: 'oldrel'}
- {os: windows-latest, r: 'devel'}
- {os: windows-latest, r: 'release'}
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
- {os: ubuntu-latest, r: 'release'}
- {os: ubuntu-latest, r: 'oldrel-1'}
- {os: windows-latest, r: 'oldrel'}
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
- {os: ubuntu-latest, r: 'release'}
- {os: ubuntu-latest, r: 'oldrel'}

env:
R_KEEP_PKG_SOURCE: yes
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
RSPM: ${{ matrix.config.rspm }}
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes

steps:
- uses: actions/checkout@v3

- uses: r-lib/actions/setup-pandoc@v2
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
http-user-agent: ${{ matrix.config.http-user-agent }}
use-public-rspm: true

- uses: r-lib/actions/setup-pandoc@v2

- uses: r-lib/actions/setup-r-dependencies@v2
- name: "[Custom block] [MacOS] Install spatial libraries"
if: runner.os == 'macOS'
run: brew install udunits gdal proj geos

- name: "[Custom block] [Linux] Install spatial libraries"
if: runner.os == 'Linux'
run: sudo apt-get install libudunits2-dev libgdal-dev libproj-dev libgeos-dev

- name: Query dependencies
run: |
install.packages('remotes')
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
shell: Rscript {0}

- name: Cache R packages
if: runner.os != 'Windows'
uses: actions/cache@v3
with:
extra-packages: any::rcmdcheck
needs: check
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-r-${{ matrix.config.r }}-1-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-

- name: Install dependencies
run: |
remotes::install_deps(dependencies = TRUE, build = FALSE)
remotes::install_cran("rcmdcheck")
shell: Rscript {0}

# - name: "[Custom block] [MacOS] Install units with configuration"
# if: runner.os == 'macOS'
# run: |
# install.packages('udunits2', type = 'source', configure.args = '--with-udunits2-lib=/usr/local/udunits2')
# install.packages('units', type = 'source', configure.args = '--with-udunits2-lib=/usr/local/udunits2')
# shell: Rscript {0}

- name: Session info
run: |
options(width = 100)
pkgs <- installed.packages()[, "Package"]
sessioninfo::session_info(pkgs, include_base = TRUE)
shell: Rscript {0}

- name: Check
env:
_R_CHECK_CRAN_INCOMING_REMOTE_: false
run: rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "warning", check_dir = "check")
shell: Rscript {0}

- uses: r-lib/actions/check-r-package@v2
- name: Upload check results
if: failure()
uses: actions/upload-artifact@main
with:
upload-snapshots: true
name: ${{ runner.os }}-r${{ matrix.config.r }}-results
path: check
95 changes: 95 additions & 0 deletions .github/workflows/rhub.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
# R-hub's generic GitHub Actions workflow file. It's canonical location is at
# https://github.com/r-hub/actions/blob/v1/workflows/rhub.yaml
# You can update this file to a newer version using the rhub2 package:
#
# rhub::rhub_setup()
#
# It is unlikely that you need to modify this file manually.

name: R-hub
run-name: "${{ github.event.inputs.id }}: ${{ github.event.inputs.name || format('Manually run by {0}', github.triggering_actor) }}"

on:
workflow_dispatch:
inputs:
config:
description: 'A comma separated list of R-hub platforms to use.'
type: string
default: 'linux,windows,macos'
name:
description: 'Run name. You can leave this empty now.'
type: string
id:
description: 'Unique ID. You can leave this empty now.'
type: string

jobs:

setup:
runs-on: ubuntu-latest
outputs:
containers: ${{ steps.rhub-setup.outputs.containers }}
platforms: ${{ steps.rhub-setup.outputs.platforms }}

steps:
# NO NEED TO CHECKOUT HERE
- uses: r-hub/actions/setup@v1
with:
config: ${{ github.event.inputs.config }}
id: rhub-setup

linux-containers:
needs: setup
if: ${{ needs.setup.outputs.containers != '[]' }}
runs-on: ubuntu-latest
name: ${{ matrix.config.label }}
strategy:
fail-fast: false
matrix:
config: ${{ fromJson(needs.setup.outputs.containers) }}
container:
image: ${{ matrix.config.container }}

steps:
- uses: r-hub/actions/checkout@v1
- uses: r-hub/actions/platform-info@v1
with:
token: ${{ secrets.RHUB_TOKEN }}
job-config: ${{ matrix.config.job-config }}
- uses: r-hub/actions/setup-deps@v1
with:
token: ${{ secrets.RHUB_TOKEN }}
job-config: ${{ matrix.config.job-config }}
- uses: r-hub/actions/run-check@v1
with:
token: ${{ secrets.RHUB_TOKEN }}
job-config: ${{ matrix.config.job-config }}

other-platforms:
needs: setup
if: ${{ needs.setup.outputs.platforms != '[]' }}
runs-on: ${{ matrix.config.os }}
name: ${{ matrix.config.label }}
strategy:
fail-fast: false
matrix:
config: ${{ fromJson(needs.setup.outputs.platforms) }}

steps:
- uses: r-hub/actions/checkout@v1
- uses: r-hub/actions/setup-r@v1
with:
job-config: ${{ matrix.config.job-config }}
token: ${{ secrets.RHUB_TOKEN }}
- uses: r-hub/actions/platform-info@v1
with:
token: ${{ secrets.RHUB_TOKEN }}
job-config: ${{ matrix.config.job-config }}
- uses: r-hub/actions/setup-deps@v1
with:
job-config: ${{ matrix.config.job-config }}
token: ${{ secrets.RHUB_TOKEN }}
- uses: r-hub/actions/run-check@v1
with:
job-config: ${{ matrix.config.job-config }}
token: ${{ secrets.RHUB_TOKEN }}
55 changes: 36 additions & 19 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: ndi
Title: Neighborhood Deprivation Indices
Version: 0.1.4.9001
Date: 2023-01-18
Version: 0.1.6.9002
Date: 2024-08-22
Authors@R:
c(person(given = "Ian D.",
family = "Buller",
Expand All @@ -21,28 +21,43 @@ Description: Computes various metrics of socio-economic deprivation and disparit
and (2) based on Andrews et al. (2020) <doi:10.1080/17445647.2020.1750066>
and Slotman et al. (2022) <doi:10.1016/j.dib.2022.108002>
who use variables chosen by Roux and Mair (2010)
<doi:10.1111/j.1749-6632.2009.05333.x>. Both are a decomposition
of multiple demographic characteristics from the U.S. Census Bureau
American Community Survey 5-year estimates (ACS-5; 2006-2010 onward). Using data
from the ACS-5 (2005-2009 onward), the package can also (1) compute the spatial
Racial Isolation Index (RI) based on Anthopolos et al. (2011)
<doi:10.1016/j.sste.2011.06.002>, (2) compute the spatial Educational Isolation
Index (EI) based on Bravo et al. (2021) <doi:10.3390/ijerph18179384>,
(3) compute the aspatial Index of Concentration at the Extremes (ICE) based on
Feldman et al. (2015) <doi:10.1136/jech-2015-205728> and Krieger et al.
(2016) <doi:10.2105/AJPH.2015.302955>, (4) compute the aspatial racial/ethnic
Dissimilarity Index based on Duncan & Duncan (1955) <doi:10.2307/2088328>, (5)
compute the aspatial Atkinson Index based on Atkinson (1970)
<doi:10.1016/0022-0531(70)90039-6>, and (6) retrieve the aspatial Gini Index
based on Gini (1921) <doi:10.2307/2223319>.
<doi:10.1111/j.1749-6632.2009.05333.x>. Both are a decomposition of multiple
demographic characteristics from the U.S. Census Bureau American Community
Survey 5-year estimates (ACS-5; 2006-2010 onward). Using data from the ACS-5
(2005-2009 onward), the package can also (1) compute the spatial Racial Isolation
Index (RI) based on Anthopolos et al. (2011) <doi:10.1016/j.sste.2011.06.002>,
(2) compute the spatial Educational Isolation Index (EI) based on Bravo et al.
(2021) <doi:10.3390/ijerph18179384>, (3) compute the aspatial Index of
Concentration at the Extremes (ICE) based on Feldman et al. (2015)
<doi:10.1136/jech-2015-205728> and Krieger et al. (2016)
<doi:10.2105/AJPH.2015.302955>, (4) compute the aspatial racial/ethnic
Dissimilarity Index (D) based on Duncan & Duncan (1955) <doi:10.2307/2088328>, (5)
compute the aspatial income or racial/ethnic Atkinson Index (A) based on Atkinson
(1970) <doi:10.1016/0022-0531(70)90039-6>, (6) aspatial racial/ethnic Interaction
Index (xPy*) based on Shevky & Williams (1949; ISBN-13:978-0-837-15637-8) and Bell
(1954) <doi:10.2307/2574118>, (7) aspatial racial/ethnic Correlation Ratio (V)
based on Bell (1954) <doi:10.2307/2574118> and White (1986) <doi:10.2307/3644339>,
(8) aspatial racial/ethnic Location Quotient (LQ) based on Merton (1939)
<doi:10.2307/2084686> and Sudano et al. (2013)
<doi:10.1016/j.healthplace.2012.09.015>, (9) aspatial racial/ethnic Local
Exposure and Isolation (LEx/Is) metric based on Bemanian & Beyer (2017)
<doi:10.1158/1055-9965.EPI-16-0926>, (10) aspatial racial/ethnic Delta (DEL)
based on Hoover (1941) <doi:10.1017/S0022050700052980> and Duncan et al. (1961;
LC:60007089), (11) an index of spatial proximity (SP) based on White (1986)
<doi:10.2307/3644339> and Blau (1977; ISBN-13:978-0-029-03660-0), and (12) the
aspatial racial/ethnic Isolatoin Index (xPx*) based on Lieberson (1981;
ISBN-13:978-1-032-53884-6) and Bell (1954) <doi:10.2307/2574118>. Also using data
from the ACS-5 (2005-2009 onward), the package can retrieve the aspatial Gini
Index (G) based Gini (1921) <doi:10.2307/2223319>.
License: Apache License (>= 2.0)
Encoding: UTF-8
LazyData: true
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.2.2
RoxygenNote: 7.3.2
Depends:
R (>= 3.5.0)
Imports:
car,
dplyr,
MASS,
Matrix,
Expand All @@ -52,11 +67,13 @@ Imports:
stringr,
tidycensus,
tidyr,
tigris,
units,
utils
Suggests:
Suggests:
DescTools,
ggplot2,
testthat,
tigris,
R.rsp,
spelling,
usethis
Expand Down
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ accepting any such warranty or additional liability.

_END OF TERMS AND CONDITIONS_

Copyright 2022 Ian D. Buller; NCI
Copyright 2024 Ian D. Buller; NCI

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
16 changes: 16 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,31 @@

export(anthopolos)
export(atkinson)
export(bell)
export(bemanian_beyer)
export(bravo)
export(duncan)
export(gini)
export(hoover)
export(krieger)
export(lieberson)
export(messer)
export(powell_wiley)
export(sudano)
export(white)
export(white_blau)
import(dplyr)
importFrom(MASS,ginv)
importFrom(Matrix,sparseMatrix)
importFrom(car,logit)
importFrom(psych,alpha)
importFrom(psych,principal)
importFrom(sf,st_centroid)
importFrom(sf,st_distance)
importFrom(sf,st_drop_geometry)
importFrom(sf,st_geometry)
importFrom(sf,st_intersects)
importFrom(sf,st_within)
importFrom(stats,complete.cases)
importFrom(stats,cor)
importFrom(stats,cov2cor)
Expand All @@ -30,4 +41,9 @@ importFrom(stringr,str_trim)
importFrom(tidycensus,get_acs)
importFrom(tidyr,pivot_longer)
importFrom(tidyr,separate)
importFrom(tigris,combined_statistical_areas)
importFrom(tigris,core_based_statistical_areas)
importFrom(tigris,metro_divisions)
importFrom(units,drop_units)
importFrom(units,set_units)
importFrom(utils,stack)
Loading
Loading