Skip to content

Commit

Permalink
add readme
Browse files Browse the repository at this point in the history
  • Loading branch information
mpadge committed Sep 20, 2023
1 parent d269a94 commit 068c456
Show file tree
Hide file tree
Showing 5 changed files with 130 additions and 3 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: ushardship
Title: Hardship Index from United States Census Data
Version: 0.0.1.018
Version: 0.0.1.019
Authors@R:
person(given = "Mark",
family = "Padgham",
Expand Down
59 changes: 59 additions & 0 deletions README.Rmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
---
title: "US Hardship Index"
output:
md_document:
variant: markdown_github

rmarkdown::html_vignette:
self_contained: no
---

<!-- README.md is generated from README.Rmd. Please edit that file -->

```{r opts, echo = FALSE}
knitr::opts_chunk$set (
collapse = TRUE,
warning = TRUE,
message = TRUE,
width = 120,
comment = "#>",
fig.retina = 2,
fig.path = "README-"
)
```

[![R build
status](https://github.com/UrbanAnalyst/us-hardship-index/workflows/R-CMD-check/badge.svg)](https://github.com/UrbanAnalyst/us-hardship-index/actions?query=workflow%3AR-CMD-check)
[![Project Status: Active](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)


# US Hardship Index

`us-hardship-index` is an R package for calculating a hardship index for
specified US states. It includes the single primary function
`hs_hardship_index()`, which accepts the two parameters of:

- "state" for the desired US state; and
- "year" for the desired year (with values available since 2010).

The index itself is calculated from the methodology of "*An Update on Urban
Hardship*," by Lisa M. Monteil, Richard P. Nathan, and David J. Wright (2004),
*The Nelson A. Rockefeller Institute of Goverment*. It is formed as a multiple
of the following six measures, each standardised to unit (or percentage)
scales:

- *occupancy*: Proportion of rooms with > 1 occupant per room;
- *poverty*: Proportion of households below poverty line;
- *unemployment*: Proportion of unemployed adults;
- *no_hs*: Proportion of population without highschool diploma
- *deps*: Proportion of population who may be considered dependent; that is
either under 18 or over 65
- *income*: Per-capita income

All variables are quantified such that lower values are better, except for
income. The hardship index is then simply the product of those six metrics,
again standardised to a unit (or percentage) scale. An example of the index in
action is provided by [the city of Chicago](
https://data.cityofchicago.org/Health-Human-Services/Census-Data-Selected-socioeconomic-indicators-in-C/kn9c-c2s2/data),
as a table of the six metrics plus their conversion to a composite hardship
index.
37 changes: 37 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<!-- README.md is generated from README.Rmd. Please edit that file -->

[![R build
status](https://github.com/UrbanAnalyst/us-hardship-index/workflows/R-CMD-check/badge.svg)](https://github.com/UrbanAnalyst/us-hardship-index/actions?query=workflow%3AR-CMD-check)
[![Project Status:
Active](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)

# US Hardship Index

`us-hardship-index` is an R package for calculating a hardship index for
specified US states. It includes the single primary function
`hs_hardship_index()`, which accepts the two parameters of:

- “state” for the desired US state; and
- “year” for the desired year (with values available since 2010).

The index itself is calculated from the methodology of “*An Update on
Urban Hardship*,” by Lisa M. Monteil, Richard P. Nathan, and David J.
Wright (2004), *The Nelson A. Rockefeller Institute of Goverment*. It is
formed as a multiple of the following six measures, each standardised to
unit (or percentage) scales:

- *occupancy*: Proportion of rooms with \> 1 occupant per room;
- *poverty*: Proportion of households below poverty line;
- *unemployment*: Proportion of unemployed adults;
- *no_hs*: Proportion of population without highschool diploma
- *deps*: Proportion of population who may be considered dependent; that
is either under 18 or over 65
- *income*: Per-capita income

All variables are quantified such that lower values are better, except
for income. The hardship index is then simply the product of those six
metrics, again standardised to a unit (or percentage) scale. An example
of the index in action is provided by [the city of
Chicago](https://data.cityofchicago.org/Health-Human-Services/Census-Data-Selected-socioeconomic-indicators-in-C/kn9c-c2s2/data),
as a table of the six metrics plus their conversion to a composite
hardship index.
6 changes: 4 additions & 2 deletions codemeta.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"codeRepository": "https://github.com/UrbanAnalyst/us-hardship-index",
"issueTracker": "https://github.com/UrbanAnalyst/us-hardship-index/issues",
"license": "https://spdx.org/licenses/GPL-3.0",
"version": "0.0.1.018",
"version": "0.0.1.019",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "R",
Expand Down Expand Up @@ -93,5 +93,7 @@
},
"SystemRequirements": {}
},
"fileSize": "17.381KB"
"fileSize": "19.322KB",
"contIntegration": "https://github.com/UrbanAnalyst/us-hardship-index/actions?query=workflow%3AR-CMD-check",
"developmentStatus": "https://www.repostatus.org/#active"
}
29 changes: 29 additions & 0 deletions makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
RFILE = README
VIGNETTE = parallel

all: init vignette

init:
echo "pkgdown::init_site()" | R --no-save -q

site:
echo "pkgdown::build_site()" | R --no-save q

vignette:
echo "pkgdown::build_article('$(VIGNETTE)',quiet=FALSE)" | R --no-save -q

knith: $(RFILE).Rmd
echo "rmarkdown::render('$(RFILE).Rmd',output_file='$(RFILE).html')" | R --no-save -q

doc: clean
Rscript -e 'devtools::document()'
Rscript -e 'rmarkdown::render("$(RFILE).Rmd",rmarkdown::md_document(variant="gfm"))'

open:
xdg-open docs/articles/$(VIGNETTE).html &

check:
Rscript -e 'library(pkgcheck); checks <- pkgcheck(); print(checks); summary (checks)'

clean:
rm -rf *.html *.png README_cache docs/

0 comments on commit 068c456

Please sign in to comment.