Skip to content

Commit

Permalink
throw new error when PUMA used for overlapping 5-year samples
Browse files Browse the repository at this point in the history
  • Loading branch information
walkerke committed Jan 26, 2024
1 parent 694e120 commit 8bc8d85
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 6 deletions.
Binary file modified .DS_Store
Binary file not shown.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
Package: tidycensus
Type: Package
Title: Load US Census Boundary and Attribute Data as 'tidyverse' and 'sf'-Ready Data Frames
Version: 1.6
Version: 1.6.1
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-01-25
Date: 2024-01-26
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
6 changes: 6 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# tidycensus 1.6

* Default year in `get_acs()` and `get_pums()` updated to 2022 following full release of the 2022 ACS datasets.
* Geometry support for the 118th Congress in `get_decennial()` when `sumfile = "cd118"` is used, and in `get_acs()`
* Various bug fixes and performance improvements.

# tidycensus 1.5

* Support added for the new Detailed DHC-A file, which includes the ability to query for detailed population groups. This functionality is now enabled for Summary Files 2 and 4 in past years as well with the `pop_group` argument.
Expand Down
10 changes: 7 additions & 3 deletions R/pums.R
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,12 @@ get_pums <- function(variables = NULL,
key <- get_census_api_key(key)

# Account for missing PUMAs in 2008-2012 through 2011-2015 ACS samples
if (year %in% 2012:2015 && survey == "acs5" && (!is.null(puma) || "PUMA" %in% variables)) {
stop("PUMAs are not available for end-years between 2012 and 2015 due to inconsistent PUMA boundary definitions.", call. = FALSE)
if (year %in% c(2012:2015, 2022) && survey == "acs5" && (!is.null(puma) || "PUMA" %in% variables)) {
rlang::abort(message = c(
"PUMAs are not available for the 5-year ACS with end-years between 2012 and 2015, and 2022, due to inconsistent PUMA boundary definitions.",
i = "Users can use the `PUMA00`, `PUMA10`, and `PUMA20` variables for year-specific PUMAs in these datasets.",
i = "See https://github.com/walkerke/tidycensus/issues/555 for discussion."
))
}


Expand Down Expand Up @@ -373,7 +377,7 @@ get_pums <- function(variables = NULL,
#' @param type Whether to use person or housing-level weights; either
#' \code{"housing"} or \code{"person"} (the default).
#' @param design The survey design to use when creating a survey object.
#' Currently the only option is code{"rep_weights"}/.
#' Currently the only option is \code{"rep_weights"}.
#' @param class Whether to convert to a srvyr or survey object; either
#' \code{"survey"} or \code{"srvyr"} (the default).
#'
Expand Down
2 changes: 1 addition & 1 deletion man/to_survey.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 8bc8d85

Please sign in to comment.