Skip to content

Commit

Permalink
fix #165 with error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
walkerke committed Apr 22, 2023
1 parent d660228 commit 1819ca9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Package: tigris
Type: Package
Title: Load Census TIGER/Line Shapefiles
Version: 2.0.1
Date: 2023-01-30
Version: 2.0.2
Date: 2023-04-22
Authors@R: c(
person(given="Kyle", family="Walker", email="kyle@walker-data.com", role=c("aut", "cre")),
person(given="Bob", family="Rudis", email="bob@rudis.net", role="ctb")
Expand Down
4 changes: 4 additions & 0 deletions R/enumeration_units.R
Original file line number Diff line number Diff line change
Expand Up @@ -710,6 +710,10 @@ zctas <- function(cb = FALSE, starts_with = NULL, year = NULL, state = NULL, ...

}

if (year > 2020 && cb) {
stop(sprintf("The Census Bureau has not yet released the CB ZCTA file for %s. Please use the argument `year = 2020` or `cb = FALSE` instead.", year), call. = FALSE)
}

if (!is.null(state) && year > 2010) {
stop("ZCTAs are only available by state for 2000 and 2010.")
}
Expand Down

0 comments on commit 1819ca9

Please sign in to comment.