From 8bc8d85ba1393af661356028b3d61b86a37ce026 Mon Sep 17 00:00:00 2001 From: Kyle Walker Date: Fri, 26 Jan 2024 05:41:27 -0600 Subject: [PATCH] throw new error when PUMA used for overlapping 5-year samples --- .DS_Store | Bin 8196 -> 10244 bytes DESCRIPTION | 4 ++-- NEWS.md | 6 ++++++ R/pums.R | 10 +++++++--- man/to_survey.Rd | 2 +- 5 files changed, 16 insertions(+), 6 deletions(-) diff --git a/.DS_Store b/.DS_Store index 3384325bc191e32ff8f2379e16312bb181e15781..c97e576513b90c5accb9951d959999d7cb12ea0d 100644 GIT binary patch literal 10244 zcmeHMU2GIp6h3E4=?op{6sY_xuxpD#pe+kh5Yf2pc9jDCp<8InUzyz*%fNJ|?#yUL?A>UMBr9HfWFx*h?Sg%X^23GK#0Hu0&IVXQDijX(=krHt%DNp3P5xQvAsZf zx(9eVF`p)UI>xD|N^SDn1Ny4yUonuYQ+g;V=va?(aijwwZP|W7-*#VQ$q-vGGqYP>wmh1}eCqmdL$Z zA}1E*paF8EQ3%T8(tncA6r5py9Op8_rs25p_}3_u%_yH)Ay$Z$;=c4jyO4HOH}ABl zxjn4ZW7}q?m{&8q481U*%um{us~VP`^ArqCCy~9qhNans7CUcgj;EXE6`~|c1Ipr~ zNAHSnh}Xv`JzgI>x_0gQrutaZruD~lH@ZhOBZMMZE$Z`L;RLzXk3RA*H)n>STgZ#K=e@rX{mDkqz>O|#2(4AxA4pR13$tZqtG-)_gw zxk<0FK7-olQcB*@yLD>R7|~m)X=nb#^mqoPvvU?im#=JCxAERYs;zy;c$HE;cb;4$ z?6CJ|99dmY z3Tlr-0PrT{_*zL)oSwsE5L{Jm+8|1bw$oHIy6Lm-*-Wf$y(4@Ld}hu4qSTkQhlXg9 z4(COZt)i%0+|N4Rt~ze#ux?EZDY-=ycRL5woZeX=b1Z6X7e#MTiO*D0n&H|xjz(>y zOBDNAW6hdI?NlvVys$eRi3});VT~AM{IsOp2b3>GQLIZe@inPStnxF(#qxlzOT>9u zBC}iy>!203!vS*8qi_;V!D)C8&cg+`1mD9ia22j0;!Lc-Sy+klaS7I9JvQJPjN>M3 z!6dfg1DM9WxDWT^A#~8iJQna6K8a7^)A$TNhcDtOdLf56~ZE+R;Uw}3ys1?VXLrRXcsz!PN7dwg+qcZjPeNx zMVH%GoS@HVkC4;3oWGd}XQy|$=!09@wr>0HxZLGAo|Db5xotu0j#X>c-+f>6geh{% zEgI`&C-Ce(;4Plrd$v((v*eDECGxW9PI3%=^oAP-{a2}A&MPu=jodERMU`@L9bUXs zUKv$plH2g&>S#k$5y)G4F&Zf~>m(yKo2g;7+pe1E^vaH5@`4 zhcQR?eheSQ$MA7{0#D#cvi9fk1$-G_#nb ze;*7|Y^39e1%oB>>{u~bzKlkof)$kV4il55BL923vR!}G0 z9LQ5_q;`gBH@D$Xut$baK);;yZTgv0)}N3GNJ=n5Jq=PHI_bESPGd0v4FW3+Ap#)+ zAp#)+w;BRvd_Xbw{-65$|Nn2bVTa=h5eN~ui3s3~)^uwNHCVhym$uE`+G7+CP-KD0 zjdAL!P~ttu6ZM|sslcA&S5joM{yT%0Px!nsPCa#!@zja(*ZhC|&j9}97T*8$@ctis K?fU=R|NjD2`iA%b delta 98 zcmZn(XmOBWU|?W$DortDU;r^WfEYvza8E20o2aMAD7-OXH$S8BW*&h$#?7b2=Q3?p n=Xt;^$P82i1QOgp!WE=^W8rt^$^0sT9E=b{7&gcA%wYxqe0vff diff --git a/DESCRIPTION b/DESCRIPTION index 27a85d9..d5d2381 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -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="kyle@walker-data.com", role=c("aut", "cre")), person(given = "Matt", family = "Herman", email = "mfherman@gmail.com", role = "aut"), person(given = "Kris", family = "Eberwein", email = "eberwein@knights.ucf.edu", 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 diff --git a/NEWS.md b/NEWS.md index c9a9d5e..6271964 100644 --- a/NEWS.md +++ b/NEWS.md @@ -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. diff --git a/R/pums.R b/R/pums.R index 9bdace5..0ca1c92 100644 --- a/R/pums.R +++ b/R/pums.R @@ -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." + )) } @@ -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). #' diff --git a/man/to_survey.Rd b/man/to_survey.Rd index ee4d936..6a12a3c 100644 --- a/man/to_survey.Rd +++ b/man/to_survey.Rd @@ -22,7 +22,7 @@ likely returned by \code{\link{get_pums}}.} \code{"survey"} or \code{"srvyr"} (the default).} \item{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"}.} } \value{ A tbl_svy or svyrep.design object.