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

PR to support LODES8 / 2020 LODES #31

Merged
merged 2 commits into from
Apr 25, 2023
Merged

Conversation

walkerke
Copy link
Contributor

Hi @jamgreen @dillonma -

This PR addresses #30 and adds support for LODES8 (2020 Census blocks) as well as LODES5 (2000 Census blocks). The main update is a new argument in grab_lodes(), version, which supports specification of the version.

I've updated the test suite including a test for the use of LODES7, and all tests pass. Would you mind taking a look when you get the chance and see if this implementation fits with your approach?

@walkerke
Copy link
Contributor Author

library(tigris)
library(lehdr)
library(tidyverse)

pdx_metro <- tracts("OR", c("Multnomah", "Washington", "Clackamas"), year = 2020, cb = TRUE)

or_wac <- grab_lodes("or", year = 2020, lodes_type = "wac",
                     agg_geo = "tract")

pdx_naics62 <- pdx_metro %>%
  select(GEOID) %>%
  inner_join(or_wac, by = c("GEOID" = "w_tract")) %>%
  transmute(
    GEOID = GEOID,
    prop_naics62 = CNS16 / C000
  )

ggplot(pdx_naics62, aes(fill = prop_naics62)) + 
  theme_void() + 
  geom_sf() + 
  scale_fill_viridis_c(labels = scales::label_percent())

image

@dillonma dillonma merged commit d74887e into jamgreen:master Apr 25, 2023
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants