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
- Host: GitHub
- URL: https://github.com/edavidaja/urbanindex
- Owner: edavidaja
- License: cc0-1.0
- Created: 2020-04-15T16:12:00.000Z (about 6 years ago)
- Default Branch: main
- Last Pushed: 2023-05-22T15:11:51.000Z (about 3 years ago)
- Last Synced: 2025-03-06T02:44:12.152Z (over 1 year ago)
- Topics: 538, rspatial, rstats
- Language: R
- Homepage: https://edavidaja.com/posts/fivethirtyeight-urban-index/
- Size: 2.73 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.Rmd
- License: LICENSE.md
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