Here's how to get the county geometry
library(tidycensus)
iowa_co <- get_acs(geography = "county", variables = "B19013_001",
state = "IA", geometry = TRUE, year = 2020)
#> Getting data from the 2016-2020 5-year ACS
#> Warning: • You have not set a Census API key. Users without a key are limited to 500
#> queries per day and may experience performance limitations.
#> ℹ For best results, get a Census API key at
#> http://api.census.gov/data/key_signup.html and then supply the key to the
#> `census_api_key()` function to use it throughout your tidycensus session.
#> This warning is displayed once per session.
#> Downloading feature geometry from the Census website. To cache shapefiles for use in future sessions, set `options(tigris_use_cache = TRUE)`.
#> | | | 0% | | | 1% | |= | 1% | |= | 2% | |== | 2% | |== | 3% | |=== | 4% | |==== | 6% | |===== | 7% | |====== | 8% | |====== | 9% | |======= | 10% | |======= | 11% | |======== | 11% | |========= | 13% | |========== | 15% | |=========== | 16% | |============ | 17% | |============= | 18% | |============= | 19% | |============== | 20% | |=============== | 21% | |=============== | 22% | |================ | 23% | |================== | 26% | |=================== | 27% | |===================== | 30% | |======================= | 33% | |======================== | 34% | |========================== | 38% | |=========================== | 38% | |=========================== | 39% | |============================ | 40% | |============================= | 42% | |============================== | 43% | |============================== | 44% | |=============================== | 45% | |================================ | 45% | |================================= | 46% | |================================= | 47% | |=================================== | 51% | |===================================== | 52% | |===================================== | 53% | |====================================== | 55% | |========================================= | 58% | |=========================================== | 61% | |============================================ | 63% | |============================================= | 64% | |=============================================== | 67% | |=============================================== | 68% | |================================================= | 70% | |================================================== | 71% | |==================================================== | 74% | |====================================================== | 77% | |======================================================= | 78% | |======================================================= | 79% | |======================================================== | 79% | |======================================================== | 80% | |========================================================= | 81% | |========================================================= | 82% | |============================================================ | 85% | |============================================================ | 86% | |=============================================================== | 89% | |================================================================= | 93% | |================================================================== | 94% | |================================================================== | 95% | |=================================================================== | 95% | |=================================================================== | 96% | |==================================================================== | 96% | |===================================================================== | 98% | |======================================================================| 100%
head(iowa_co)
#> Simple feature collection with 6 features and 5 fields
#> Geometry type: MULTIPOLYGON
#> Dimension: XY
#> Bounding box: xmin: -96.63862 ymin: 41.7277 xmax: -90.14006 ymax: 43.50047
#> Geodetic CRS: NAD83
#> GEOID NAME variable estimate moe
#> 1 19143 Osceola County, Iowa B19013_001 61167 5550
#> 2 19075 Grundy County, Iowa B19013_001 71760 2530
#> 3 19041 Clay County, Iowa B19013_001 51259 4208
#> 4 19081 Hancock County, Iowa B19013_001 61957 2562
#> 5 19045 Clinton County, Iowa B19013_001 52221 1825
#> 6 19149 Plymouth County, Iowa B19013_001 71147 3210
#> geometry
#> 1 MULTIPOLYGON (((-95.86127 4...
#> 2 MULTIPOLYGON (((-93.02679 4...
#> 3 MULTIPOLYGON (((-95.38863 4...
#> 4 MULTIPOLYGON (((-93.97129 4...
#> 5 MULTIPOLYGON (((-90.89894 4...
#> 6 MULTIPOLYGON (((-96.63836 4...
Created on 2023-03-15 with reprex v2.0.2
I don't know what is meant by "subregion" or understand the objective of combining with counties. Are sub-regions groups of counties or sections of counties? Is each county in only one sub-region or each sub-region in only one county? Consider a reprex
. See the FAQ.