diff --git a/.DS_Store b/.DS_Store deleted file mode 100644 index 80cb136..0000000 Binary files a/.DS_Store and /dev/null differ diff --git a/DESCRIPTION b/DESCRIPTION index fcc889c..3d729c8 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.4 +Version: 1.6.5 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-05-16 +Date: 2024-07-16 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/R/estimates.R b/R/estimates.R index bc95806..5b0f493 100644 --- a/R/estimates.R +++ b/R/estimates.R @@ -103,8 +103,8 @@ get_estimates <- function(geography = c("us", "region", "division", "state", "co rlang::abort("The only supported geographies at this time for population characteristics 2020 and later are 'state' and 'county'.") } - if (vintage > 2022) { - rlang::abort("The Characteristics dataset has not yet been released for vintages beyond 2022") + if (vintage > 2023) { + rlang::abort("The Characteristics dataset has not yet been released for vintages beyond 2023") } if (geography == "state") { @@ -156,17 +156,17 @@ get_estimates <- function(geography = c("us", "region", "division", "state", "co } else if (geography == "county") { - if (vintage > 2022) { + if (vintage > 2023) { rlang::abort("The county characteristics dataset for this vintage has not yet been released.") } if (!is.null(state)) { state <- validate_state(state) - county_raw <- suppressMessages(readr::read_csv(sprintf("https://www2.census.gov/programs-surveys/popest/datasets/2020-2022/counties/asrh/cc-est2022-alldata-%s.csv", state))) + county_raw <- suppressMessages(readr::read_csv(sprintf("https://www2.census.gov/programs-surveys/popest/datasets/2020-%s/counties/asrh/cc-est%s-alldata-%s.csv", vintage, vintage, state))) } else { - county_raw <- suppressMessages(readr::read_csv("https://www2.census.gov/programs-surveys/popest/datasets/2020-2022/counties/asrh/cc-est2022-all.csv")) + county_raw <- suppressMessages(readr::read_csv(sprintf("https://www2.census.gov/programs-surveys/popest/datasets/2020-%s/counties/asrh/cc-est%s-all.csv", vintage, vintage))) } @@ -234,7 +234,8 @@ get_estimates <- function(geography = c("us", "region", "division", "state", "co dplyr::mutate(year = dplyr::case_when( year == 2 ~ 2020L, year == 3 ~ 2021L, - year == 4 ~ 2022L + year == 4 ~ 2022L, + year == 5 ~ 2023L )) } else {