From 106043bcf10d6eabfd0f4430e994ad3441852cd2 Mon Sep 17 00:00:00 2001 From: Kyle Walker Date: Thu, 23 Jan 2025 13:45:42 -0600 Subject: [PATCH] support rep weights correctly with recodes in 2023 ACS --- R/pums.R | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/R/pums.R b/R/pums.R index 5e328dc..64fbf2a 100644 --- a/R/pums.R +++ b/R/pums.R @@ -202,10 +202,17 @@ get_pums <- function(variables = NULL, # merge that in as well if (recode) { + + if (year < 2023) { + state_label <- "ST_label" + } else { + state_label <- "STATE_label" + } + if (!is.null(puma)) { - join_vars <- c(join_vars, "ST_label", "PUMA") + join_vars <- c(join_vars, state_label, "PUMA") } else { - join_vars <- c(join_vars, "ST_label") + join_vars <- c(join_vars, state_label) } } else { if (!is.null(puma)) {