An open API service indexing awesome lists of open source software.

https://github.com/edavidaja/urbanindex

recreating the 538 urban index
https://github.com/edavidaja/urbanindex

538 rspatial rstats

Last synced: 10 months ago
JSON representation

recreating the 538 urban index

Awesome Lists containing this project

README

          

---
output: github_document
---

```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```

# urbanindex

incorrectly calculating the [538 urbanization index](https://fivethirtyeight.com/features/how-urban-or-rural-is-your-state-and-what-does-that-mean-for-the-2020-election/) for each census tract

## inspiration

https://twitter.com/NateSilver538/status/1200498385125433344

## Installation

You can install urbanindex from [github](https://github.com/edavidaja/urbanindex) with:

```{r, eval=FALSE}
install.packages("edavidaja/urbanindex")
```

if that doesn't work--have you met [`{renv}`](https://rstudio.github.io/renv/articles/renv.html)?

## Example

```{r example}
library(urbanindex)
head(pop_within_5_mi)
```

## garden of forking paths

a differently wrong approach uses `st_is_within_distance` to identify tract centroids within five miles of each other, available on the [centroid-self-join](https://github.com/edavidaja/urbanindex/tree/centroid-self-join) branch