-
-
Notifications
You must be signed in to change notification settings - Fork 45
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
New CT county equivalents #178
Comments
Counties are updated, but the consituent pieces seem not to be. Census has had frustratingly poor documentation of this change. library(tigris)
#> Warning: package 'tigris' was built under R version 4.2.3
#> To enable caching of data, set `options(tigris_use_cache = TRUE)`
#> in your R script or .Rprofile.
ct_2022 <- counties(year = 2022, state = "09")
#> | | | 0% | | | 1% | |= | 1% | |= | 2% | |== | 2% | |== | 3% | |== | 4% | |=== | 4% | |=== | 5% | |==== | 5% | |==== | 6% | |===== | 6% | |===== | 7% | |===== | 8% | |====== | 8% | |====== | 9% | |======= | 9% | |======= | 10% | |======= | 11% | |======== | 11% | |======== | 12% | |========= | 12% | |========= | 13% | |========= | 14% | |========== | 14% | |========== | 15% | |=========== | 15% | |=========== | 16% | |============ | 16% | |============ | 17% | |============ | 18% | |============= | 18% | |============= | 19% | |============== | 19% | |============== | 20% | |============== | 21% | |=============== | 21% | |=============== | 22% | |================ | 22% | |================ | 23% | |================ | 24% | |================= | 24% | |================= | 25% | |================== | 25% | |================== | 26% | |=================== | 26% | |=================== | 27% | |=================== | 28% | |==================== | 28% | |==================== | 29% | |===================== | 29% | |===================== | 30% | |===================== | 31% | |====================== | 31% | |====================== | 32% | |======================= | 32% | |======================= | 33% | |======================= | 34% | |======================== | 34% | |======================== | 35% | |========================= | 35% | |========================= | 36% | |========================== | 36% | |========================== | 37% | |========================== | 38% | |=========================== | 38% | |=========================== | 39% | |============================ | 39% | |============================ | 40% | |============================ | 41% | |============================= | 41% | |============================= | 42% | |============================== | 42% | |============================== | 43% | |============================== | 44% | |=============================== | 44% | |=============================== | 45% | |================================ | 45% | |================================ | 46% | |================================= | 46% | |================================= | 47% | |================================= | 48% | |================================== | 48% | |================================== | 49% | |=================================== | 49% | |=================================== | 50% | |=================================== | 51% | |==================================== | 51% | |==================================== | 52% | |===================================== | 52% | |===================================== | 53% | |===================================== | 54% | |====================================== | 54% | |====================================== | 55% | |======================================= | 55% | |======================================= | 56% | |======================================== | 56% | |======================================== | 57% | |======================================== | 58% | |========================================= | 58% | |========================================= | 59% | |========================================== | 59% | |========================================== | 60% | |========================================== | 61% | |=========================================== | 61% | |=========================================== | 62% | |============================================ | 62% | |============================================ | 63% | |============================================ | 64% | |============================================= | 64% | |============================================= | 65% | |============================================== | 65% | |============================================== | 66% | |=============================================== | 66% | |=============================================== | 67% | |=============================================== | 68% | |================================================ | 68% | |================================================ | 69% | |================================================= | 69% | |================================================= | 70% | |================================================= | 71% | |================================================== | 71% | |================================================== | 72% | |=================================================== | 72% | |=================================================== | 73% | |=================================================== | 74% | |==================================================== | 74% | |==================================================== | 75% | |===================================================== | 75% | |===================================================== | 76% | |====================================================== | 76% | |====================================================== | 77% | |====================================================== | 78% | |======================================================= | 78% | |======================================================= | 79% | |======================================================== | 79% | |======================================================== | 80% | |======================================================== | 81% | |========================================================= | 81% | |========================================================= | 82% | |========================================================== | 82% | |========================================================== | 83% | |========================================================== | 84% | |=========================================================== | 84% | |=========================================================== | 85% | |============================================================ | 85% | |============================================================ | 86% | |============================================================= | 86% | |============================================================= | 87% | |============================================================= | 88% | |============================================================== | 88% | |============================================================== | 89% | |=============================================================== | 89% | |=============================================================== | 90% | |=============================================================== | 91% | |================================================================ | 91% | |================================================================ | 92% | |================================================================= | 92% | |================================================================= | 93% | |================================================================= | 94% | |================================================================== | 94% | |================================================================== | 95% | |=================================================================== | 95% | |=================================================================== | 96% | |==================================================================== | 96% | |==================================================================== | 97% | |==================================================================== | 98% | |===================================================================== | 98% | |===================================================================== | 99% | |======================================================================| 99% | |======================================================================| 100%
# counties are updated
print(ct_2022)
#> Simple feature collection with 9 features and 17 fields
#> Geometry type: MULTIPOLYGON
#> Dimension: XY
#> Bounding box: xmin: -73.72777 ymin: 40.95094 xmax: -71.78724 ymax: 42.05051
#> Geodetic CRS: NAD83
#> STATEFP COUNTYFP COUNTYNS GEOID NAME
#> 1393 09 110 02830244 09110 Capitol
#> 1394 09 120 02830245 09120 Greater Bridgeport
#> 1395 09 130 02830246 09130 Lower Connecticut River Valley
#> 1396 09 140 02830249 09140 Naugatuck Valley
#> 1397 09 150 02830250 09150 Northeastern Connecticut
#> 1398 09 160 02830251 09160 Northwest Hills
#> 1399 09 170 02830252 09170 South Central Connecticut
#> 1400 09 180 02830253 09180 Southeastern Connecticut
#> 1401 09 190 02830254 09190 Western Connecticut
#> NAMELSAD LSAD CLASSFP MTFCC CSAFP
#> 1393 Capitol Planning Region PL H5 G4020 <NA>
#> 1394 Greater Bridgeport Planning Region PL H5 G4020 <NA>
#> 1395 Lower Connecticut River Valley Planning Region PL H5 G4020 <NA>
#> 1396 Naugatuck Valley Planning Region PL H5 G4020 <NA>
#> 1397 Northeastern Connecticut Planning Region PL H5 G4020 <NA>
#> 1398 Northwest Hills Planning Region PL H5 G4020 <NA>
#> 1399 South Central Connecticut Planning Region PL H5 G4020 <NA>
#> 1400 Southeastern Connecticut Planning Region PL H5 G4020 <NA>
#> 1401 Western Connecticut Planning Region PL H5 G4020 <NA>
#> CBSAFP METDIVFP FUNCSTAT ALAND AWATER INTPTLAT INTPTLON
#> 1393 <NA> <NA> N 2660771860 48836864 +41.8169700 -072.5758861
#> 1394 <NA> <NA> N 363067865 253764138 +41.1845583 -073.2094009
#> 1395 <NA> <NA> N 1098452313 241091041 +41.4203071 -072.4935251
#> 1396 <NA> <NA> N 1069106116 22748115 +41.5189311 -073.0879059
#> 1397 <NA> <NA> N 1434573470 23995619 +41.8423749 -071.9726550
#> 1398 <NA> <NA> N 2037392863 55597912 +41.8548092 -073.2214944
#> 1399 <NA> <NA> N 950963144 653739738 +41.2901671 -072.8370243
#> 1400 <NA> <NA> N 1549162991 216462800 +41.4847688 -072.1016655
#> 1401 <NA> <NA> N 1378176376 300211454 +41.2790553 -073.4465497
#> geometry
#> 1393 MULTIPOLYGON (((-72.33423 4...
#> 1394 MULTIPOLYGON (((-73.14688 4...
#> 1395 MULTIPOLYGON (((-72.24852 4...
#> 1396 MULTIPOLYGON (((-73.06785 4...
#> 1397 MULTIPOLYGON (((-72.23479 4...
#> 1398 MULTIPOLYGON (((-72.99895 4...
#> 1399 MULTIPOLYGON (((-72.88667 4...
#> 1400 MULTIPOLYGON (((-72.05006 4...
#> 1401 MULTIPOLYGON (((-73.29556 4...
#blocks are not
block_ct_2022 <- blocks(county = "110", state = "09", year = 2022)
#> | | | 0% | | | 1% | |= | 1% | |= | 2% | |== | 2% | |== | 3% | |== | 4% | |=== | 4% | |=== | 5% | |==== | 5% | |==== | 6% | |===== | 6% | |===== | 7% | |===== | 8% | |====== | 8% | |====== | 9% | |======= | 9% | |======= | 10% | |======= | 11% | |======== | 11% | |======== | 12% | |========= | 12% | |========= | 13% | |========= | 14% | |========== | 14% | |========== | 15% | |=========== | 15% | |=========== | 16% | |============ | 17% | |============ | 18% | |============= | 18% | |============= | 19% | |============== | 19% | |============== | 20% | |============== | 21% | |=============== | 21% | |=============== | 22% | |================ | 22% | |================ | 23% | |================ | 24% | |================= | 24% | |================= | 25% | |================== | 25% | |================== | 26% | |=================== | 26% | |=================== | 27% | |=================== | 28% | |==================== | 28% | |==================== | 29% | |===================== | 29% | |===================== | 30% | |===================== | 31% | |====================== | 31% | |====================== | 32% | |======================= | 32% | |======================= | 33% | |======================= | 34% | |======================== | 34% | |======================== | 35% | |========================= | 35% | |========================= | 36% | |========================== | 37% | |========================== | 38% | |=========================== | 38% | |=========================== | 39% | |============================ | 39% | |============================ | 40% | |============================ | 41% | |============================= | 41% | |============================= | 42% | |============================== | 42% | |============================== | 43% | |============================== | 44% | |=============================== | 44% | |=============================== | 45% | |================================ | 45% | |================================ | 46% | |================================= | 46% | |================================= | 47% | |================================= | 48% | |================================== | 48% | |================================== | 49% | |=================================== | 49% | |=================================== | 50% | |=================================== | 51% | |==================================== | 51% | |==================================== | 52% | |===================================== | 52% | |===================================== | 53% | |===================================== | 54% | |====================================== | 54% | |====================================== | 55% | |======================================= | 55% | |======================================= | 56% | |======================================== | 56% | |======================================== | 57% | |======================================== | 58% | |========================================= | 58% | |========================================= | 59% | |========================================== | 59% | |========================================== | 60% | |========================================== | 61% | |=========================================== | 61% | |=========================================== | 62% | |============================================ | 62% | |============================================ | 63% | |============================================= | 64% | |============================================= | 65% | |============================================== | 65% | |============================================== | 66% | |=============================================== | 66% | |=============================================== | 67% | |=============================================== | 68% | |================================================ | 68% | |================================================ | 69% | |================================================= | 69% | |================================================= | 70% | |================================================= | 71% | |================================================== | 71% | |================================================== | 72% | |=================================================== | 72% | |=================================================== | 73% | |=================================================== | 74% | |==================================================== | 74% | |==================================================== | 75% | |===================================================== | 75% | |===================================================== | 76% | |====================================================== | 76% | |====================================================== | 77% | |====================================================== | 78% | |======================================================= | 78% | |======================================================= | 79% | |======================================================== | 79% | |======================================================== | 80% | |======================================================== | 81% | |========================================================= | 81% | |========================================================= | 82% | |========================================================== | 82% | |========================================================== | 83% | |=========================================================== | 84% | |=========================================================== | 85% | |============================================================ | 85% | |============================================================ | 86% | |============================================================= | 86% | |============================================================= | 87% | |============================================================= | 88% | |============================================================== | 88% | |============================================================== | 89% | |=============================================================== | 89% | |=============================================================== | 90% | |=============================================================== | 91% | |================================================================ | 91% | |================================================================ | 92% | |================================================================= | 92% | |================================================================= | 93% | |================================================================= | 94% | |================================================================== | 94% | |================================================================== | 95% | |=================================================================== | 95% | |=================================================================== | 96% | |==================================================================== | 96% | |==================================================================== | 97% | |==================================================================== | 98% | |===================================================================== | 98% | |===================================================================== | 99% | |======================================================================| 99% | |======================================================================| 100%
nrow(block_ct_2022)
#> [1] 0 Created on 2023-10-16 with reprex v2.0.2 |
@arthurgailes I checked tracts and block groups for 2022 and they are updated to the new planning regions. You are correct that blocks are not, however. The 2023 files are supposed to be out this month, so we'll want to check once they are released. |
Thanks so much for your help y'all. Much appreciated. |
@walkerke I don't see that either the blocks or block groups have been updated. They've been released, but not sure if the API is updated. library(tigris)
#> Warning: package 'tigris' was built under R version 4.2.2
#> To enable caching of data, set `options(tigris_use_cache = TRUE)`
#> in your R script or .Rprofile.
ct_2023 <- counties(year = 2023, state = "09")
print(ct_2023[, c("COUNTYFP", "NAMELSAD")])
#> Simple feature collection with 9 features and 2 fields
#> Geometry type: MULTIPOLYGON
#> Dimension: XY
#> Bounding box: xmin: -73.72777 ymin: 40.95094 xmax: -71.78724 ymax: 42.05051
#> Geodetic CRS: NAD83
#> COUNTYFP NAMELSAD
#> 1393 110 Capitol Planning Region
#> 1394 120 Greater Bridgeport Planning Region
#> 1395 130 Lower Connecticut River Valley Planning Region
#> 1396 140 Naugatuck Valley Planning Region
#> 1397 150 Northeastern Connecticut Planning Region
#> 1398 160 Northwest Hills Planning Region
#> 1399 170 South Central Connecticut Planning Region
#> 1400 180 Southeastern Connecticut Planning Region
#> 1401 190 Western Connecticut Planning Region
#> geometry
#> 1393 MULTIPOLYGON (((-72.33423 4...
#> 1394 MULTIPOLYGON (((-73.14688 4...
#> 1395 MULTIPOLYGON (((-72.24852 4...
#> 1396 MULTIPOLYGON (((-73.06785 4...
#> 1397 MULTIPOLYGON (((-72.23479 4...
#> 1398 MULTIPOLYGON (((-72.99895 4...
#> 1399 MULTIPOLYGON (((-72.88667 4...
#> 1400 MULTIPOLYGON (((-72.05006 4...
#> 1401 MULTIPOLYGON (((-73.29556 4...
bg_ct_2023 <- block_groups(county = "110", state = "09", year = 2023)
#> Warning: '110' is not a valid FIPS code for counties in Connecticut
nrow(bg_ct_2023)
#> [1] 0
block_ct_2023 <- blocks(county = "110", state = "09", year = 2023)
#> Warning: '110' is not a valid FIPS code for counties in Connecticut
nrow(block_ct_2023)
#> [1] 0 Created on 2023-12-01 with reprex v2.0.2 |
Update: this is now working for both tigris and tidycensus at the tract and block group, but not for the block library(tigris)
#> Warning: package 'tigris' was built under R version 4.2.3
#> To enable caching of data, set `options(tigris_use_cache = TRUE)`
#> in your R script or .Rprofile.
ct_2023 <- counties(year = 2023, state = "09")
print(ct_2023[, c("COUNTYFP", "NAMELSAD")])
#> Simple feature collection with 9 features and 2 fields
#> Geometry type: MULTIPOLYGON
#> Dimension: XY
#> Bounding box: xmin: -73.72777 ymin: 40.95094 xmax: -71.78724 ymax: 42.05051
#> Geodetic CRS: NAD83
#> COUNTYFP NAMELSAD
#> 1393 110 Capitol Planning Region
#> 1394 120 Greater Bridgeport Planning Region
#> 1395 130 Lower Connecticut River Valley Planning Region
#> 1396 140 Naugatuck Valley Planning Region
#> 1397 150 Northeastern Connecticut Planning Region
#> 1398 160 Northwest Hills Planning Region
#> 1399 170 South Central Connecticut Planning Region
#> 1400 180 Southeastern Connecticut Planning Region
#> 1401 190 Western Connecticut Planning Region
#> geometry
#> 1393 MULTIPOLYGON (((-72.33423 4...
#> 1394 MULTIPOLYGON (((-73.14688 4...
#> 1395 MULTIPOLYGON (((-72.24852 4...
#> 1396 MULTIPOLYGON (((-73.06785 4...
#> 1397 MULTIPOLYGON (((-72.23479 4...
#> 1398 MULTIPOLYGON (((-72.99895 4...
#> 1399 MULTIPOLYGON (((-72.88667 4...
#> 1400 MULTIPOLYGON (((-72.05006 4...
#> 1401 MULTIPOLYGON (((-73.29556 4...
tr_ct_2023 <- tracts(county = "110", state = "09", year = 2023)
nrow(tr_ct_2023)
#> [1] 249
bg_ct_2023 <- block_groups(county = "110", state = "09", year = 2023)
nrow(bg_ct_2023)
#> [1] 731
pacman::p_load(tidycensus)
get_acs(geography = "tract",
variables = c(medincome = "B19013_001"),
state = "09", county = 110,
year = 2022)
#> Getting data from the 2018-2022 5-year ACS
#> # A tibble: 249 × 5
#> GEOID NAME variable estimate moe
#> <chr> <chr> <chr> <dbl> <dbl>
#> 1 09110400101 Census Tract 4001.01; Capitol Planning R… medinco… 85275 27136
#> 2 09110400102 Census Tract 4001.02; Capitol Planning R… medinco… 91250 8332
#> 3 09110400200 Census Tract 4002; Capitol Planning Regi… medinco… 148514 43079
#> 4 09110400300 Census Tract 4003; Capitol Planning Regi… medinco… 117163 22475
#> 5 09110415300 Census Tract 4153; Capitol Planning Regi… medinco… 42569 14369
#> 6 09110415400 Census Tract 4154; Capitol Planning Regi… medinco… 68200 13147
#> 7 09110415500 Census Tract 4155; Capitol Planning Regi… medinco… 45547 11567
#> 8 09110415600 Census Tract 4156; Capitol Planning Regi… medinco… 39722 13369
#> 9 09110415700 Census Tract 4157; Capitol Planning Regi… medinco… 56321 24109
#> 10 09110415800 Census Tract 4158; Capitol Planning Regi… medinco… 36122 6682
#> # ℹ 239 more rows
block_ct_2023 <- blocks(county = "110", state = "09", year = 2023)
nrow(block_ct_2023)
#> [1] 0 Created on 2023-12-08 with reprex v2.0.2 For others, a block crosswalk is available here: https://github.com/CT-Data-Collaborative/2022-block-crosswalk/blob/main/2022blockcrosswalk.csv |
OK, Census is officially not going to fix this, via slack. That's disappointing, but not a tigris issue, so this thread should probably be closed. Here's a gist for interested users on fixing manually: https://gist.github.com/arthurgailes/45f781c219320f3e9a962a2b3e9f55d2 |
Hey - the most recent geography for US counties doesn't include the new county-level equivalents in Connecticut. I believe Census has published these now - is it possible to get these added to the counties() function?
The text was updated successfully, but these errors were encountered: