Skip to content

Commit

Permalink
fix #570
Browse files Browse the repository at this point in the history
  • Loading branch information
walkerke committed Sep 20, 2024
1 parent 5fed58f commit 3562dcc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Authors@R: c(
person(given = "Kyle", family = "Walker", email="[email protected]", role=c("aut", "cre")),
person(given = "Matt", family = "Herman", email = "[email protected]", role = "aut"),
person(given = "Kris", family = "Eberwein", email = "[email protected]", role = "ctb"))
Date: 2024-09-19
Date: 2024-09-20
URL: https://walker-data.com/tidycensus/
BugReports: https://github.com/walkerke/tidycensus/issues
Description: An integrated R interface to several United States Census Bureau
Expand Down
11 changes: 8 additions & 3 deletions R/helpers.R
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,8 @@ use_tigris <- function(geography, year, cb = TRUE, resolution = "500k",

} else if (geography == "metropolitan statistical area/micropolitan statistical area" || geography == "cbsa") {

# 2022 CBSA files for CB not yet available
if (cb && year == 2022) {
# 2022 CBSA files not available
if (year == 2022) {
year <- 2021
}

Expand Down Expand Up @@ -314,7 +314,12 @@ use_tigris <- function(geography, year, cb = TRUE, resolution = "500k",

} else if (geography == "combined statistical area") {

csa <- combined_statistical_areas(cb = cb, class = "sf", year = year, ...)
# CSA file not published for '22, so we need '21 geometries
if (year == 2022) {
csa <- combined_statistical_areas(cb = cb, class = "sf", year = 2021, ...)
} else {
csa <- combined_statistical_areas(cb = cb, class = "sf", year = year, ...)
}

return(csa)

Expand Down

0 comments on commit 3562dcc

Please sign in to comment.