From d3a47eed1fdd4bd1d7b2912bb7536102fdc0c45e Mon Sep 17 00:00:00 2001 From: Arthur Gailes Date: Fri, 23 Feb 2024 15:04:37 -0500 Subject: [PATCH] allow underscores in geography in place of spaces --- R/acs.R | 3 +++ 1 file changed, 3 insertions(+) diff --git a/R/acs.R b/R/acs.R index 85194a7..fdac49f 100644 --- a/R/acs.R +++ b/R/acs.R @@ -200,6 +200,9 @@ get_acs <- function(geography, variables = NULL, table = NULL, cache_table = FAL if (geography == "puma") geography <- "public use microdata area" + # allow underscores and convert back to spaces + if (grepl("_", geography) & !grepl(" ", geography)) geography <- gsub("_", " ", geography) + if (any(grepl("^S[0-9]|^DP", variables)) && geography == "block group") { stop("Block groups are not an available geography in the Data Profile and Subject Tables datasets.", call. = FALSE)