Can you use the resolution
argument in get_acs()
to filter out the small islands in the Hawaiian archipelago?
I might have found a bug in tidycensus
, one of my favorite packages.
I was mapping U.S congressional districts using tidycensus
's get_acs()
function, but I was getting that long archipelago northwest of Hawaii. I tried following Kyle Walker's tip to include the resolution = "20m"
argument to filter out the small islands, but the archipelago wouldn't go away. I eventually just grabbed the geometry using the congressional_districts()
function and joined the get_acs()
data.
MRE:
#map with too many islands
cds <- get_acs(
geography = "congressional district",
variables = "B01003_001",
geometry = TRUE,
resolution = "20m"
) %>% shift_geometry()
cds %>%
ggplot() +
geom_sf()
Bad map:
What worked:
#map with the right number of islands
cds2 <- congressional_districts(cb = TRUE,
resolution = "20m") %>% shift_geometry()
cds2 %>%
ggplot() +
geom_sf()
Good map: