Skip to content

feat: Run build_vectors.R and remove zi_list_zctas() year-2024 restriction #91

@chris-prener

Description

@chris-prener

Summary

zi_list_zctas() currently hard-blocks year = 2024 (R/zi_list_zctas.R lines 66–71) with the message:

year 2024 is not yet available for zi_list_zctas(). Use 2023 or earlier.

The underlying build script (inst/build-data/build_vectors.R) already downloads and processes 2024 ZCTA data from tigris and writes both intersect and centroid reference vectors into R/sysdata.rda. The restriction exists because sysdata.rda shipped with the package has not yet been regenerated with the 2024 vectors included.

Steps to resolve

  1. Run source("inst/build-data/build_vectors.R") interactively (requires tigris, sf, dplyr, purrr and internet access to Census TIGER/Line).
  2. Verify the regenerated R/sysdata.rda contains reference_intersects and reference_centroids rows for year == 2024.
  3. Remove the year-2024 error block in R/zi_list_zctas.R (lines 66–71).
  4. Update tests in tests/testthat/test_zi_list_zctas.R to cover year = 2024.
  5. Run devtools::check() to confirm no regressions.

Acceptance criteria

  • zi_list_zctas(year = 2024, state = "MO", method = "centroid") returns a character vector of ZCTAs without error.
  • zi_list_zctas(year = 2024, state = "MO", method = "intersect") returns a character vector of ZCTAs without error.
  • All existing tests continue to pass.

Notes

  • The build script is interactive (prompts whether to use local data). Answer appropriately based on whether pre-downloaded .rda files exist under inst/data-raw/.
  • This is a human-driven task — the build script downloads ~14 years of ZCTA shapefiles and performs spatial joins, which takes significant time and requires manual oversight.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestpriority/highSignificant impact, address soon

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions