Changelog
Source:NEWS.md
urbnindicators 0.1.0
First tagged release. This version consolidates a major overhaul of the package’s API and internals.
Breaking changes
-
compile_acs_data()is now driven by atablesparameter: request registered tables by name (seelist_tables()), raw ACS table codes (e.g.,"B25070", auto-processed at runtime), and/or custom variable definitions — mixed freely inside alist(). The old behavior (all tables) remains the default whentablesis omitted. Thevariablesparameter is deprecated and ignored. - The definition helpers were consolidated:
define_percent()(witheach = TRUEfor batch mode) replacesdefine_across_percent();define_sum()replacesdefine_across_sum();define_complement()replacesdefine_one_minus(). Single-string numerators/denominators are interpreted as regular expressions. -
select_variables_by_name()andfilter_variables()are no longer exported; useget_acs_codebook()for variable discovery. -
list_acs_variables()was removed; uselist_variables(). - Literal
$characters are now stripped from generated variable names, so income- and rent-band columns (e.g., from B25074/B25106) are syntactic:household_income_..._less_than_$10000becomeshousehold_income_..._less_than_10000. - The renter cost-burden measures now carry an explicit tenure label:
cost_burdened_30percentormore_*andcost_burdened_50percentormore_*are nowcost_burdened_renter_30percentormore_*andcost_burdened_renter_50percentormore_*, disambiguating them from the new owner-side measures. - Two variables were renamed for accuracy and consistency:
employment_civilian_labor_force_percentis nowemployment_civilian_labor_force_employed_percent(it is the employment rate — employed persons over the civilian labor force), andmedian_household_income_nhpiis nowmedian_household_income_nhpi_alone, matching its sibling race-iteration names. - A Census API key is now required for all functions that read the ACS variable dictionary (including
list_variables()andget_acs_codebook()), because the Census Bureau’s variables metadata endpoint now requires a key. Set one withtidycensus::census_api_key("YOUR_KEY", install = TRUE). -
safe_divide()now returnsNA(not0) when a nonzero numerator is divided by zero;0/0still returns0. - Raw ACS table codes are now always auto-processed, even when a registered table covers the same code:
tables = "B22003"returns the auto-processed table with label-derived names, whiletables = "snap"returns the registered version (previously the raw code was silently upgraded to the registered table). Requesting both in one call returns the registered version and drops the auto-processed one with a warning, since the two would fetch duplicate variables.
New features
-
Block-group geography:
compile_acs_data(geography = "block group")is supported for 2013 and later (explicitstatesrequired). Tables the ACS does not publish at the block-group level are dropped with a warning;list_tables(geography = "block group")lists what is available. -
Custom geographies:
interpolate_acs()aggregates (complete nesting) or interpolates (fractional allocation via crosswalk weights) estimates to user-defined geographies, recalculating percentages and propagating margins of error with Census Bureau approximation formulas. -
Custom derived variables: pass
define_percent()/define_sum()/define_complement()/define_metadata()objects tocompile_acs_data(tables = ...); results are computed, documented in the codebook, and receive margins of error automatically. -
Interactive viewer:
view_acs_data()launches a local Shiny app to map results, interpolate to uploaded or hand-drawn target geographies, benchmark differences for statistical significance, and export data and images. -
Caching:
compile_acs_data(cache = TRUE)caches raw ACS query results on disk (one entry per geography-year-state-table) and reuses them across calls and R sessions, so repeat and overlapping requests – including changedtablesselections – re-download only what is missing. Entries never expire (published five-year ACS estimates do not change); a newclear_acs_cache()deletes them to reclaim disk space. -
Universe statements in the codebook. The codebook gains a
universecolumn carrying the Census Bureau’s published universe statement for each variable (e.g., “Households”, “Population 25 years and over”); derived variables inherit their numerator’s universe. Available for the 2020+ vintages (the API does not publish universes for earlier years). -
Owner cost-burden measures.
tenure_by_housing_costs(B25106) now publishes owner cost-burden percentages (all incomes, incomes below $35,000, incomes below $50,000) and an all-tenures headline measure; a newowner_cost_burdentable (B25091) adds 30-percent-or-more and 50-percent-or-more (severe) burden shares by mortgage status, plus a combined all-owners severe-burden measure. Denominators exclude households whose cost ratio is not computable (zero/negative income; renters paying no cash rent), consistent with the renter measures. - Unregistered ACS tables requested by code are auto-processed: the label hierarchy is parsed and percentages are computed against the nearest parent subtotal (configurable via the
denominatorparameter). -
yearsdefaults to the most recent ACS five-year vintage expected to be available, rather than a hard-coded year. -
Agent skill: the package ships a skill that teaches coding agents to use it correctly – variable discovery, query scoping, output conventions, margins of error, and
interpolate_acs(). Install it withregister_urbnindicators_skill().
Bug fixes and accuracy corrections
- Fixed cost-burden indicators (
cost_burdened_*): the “50.0 percent or more” rent-burden category was excluded from numerators, making the 50-percent-or-more measures zero and understating the 30-percent-or-more measures. - Fixed six indicators whose definitions over-matched subcategory columns after the definition-helper consolidation (
sex_female_percent/sex_male_percent,nativity_native_born_percent/nativity_foreign_born_percent,overcrowding_morethan1_ppr_renteroccupied_percent, health-insurance covered-employed/unemployed shares, and commute-mode shares). -
generate_codebook()and variable resolution now honor the requested year rather than resolving against the 2022 dictionary unconditionally, and block-group availability no longer breaks for vintages newer than the installedtidycensusgeography lookup. - Margin-of-error calculations were vectorized (orders-of-magnitude faster on tract-level, multi-state pulls).
- The auto-table classifier now matches its skip keywords on word boundaries, so tables whose concept contains “Means” (e.g., B08301, Means of Transportation to Work) are no longer misclassified as non-count tables (“mean”) and receive auto-computed percentages.
- The auto-table classifier now requires a table’s
_001label to end with:(or be exactlyEstimate!!Total) to compute percentages, so dollar-valued tables like B19080 (Household Income Quintile Upper Limits) no longer produce nonsense percentages of one quintile limit over another. - Fixed a typo in
make_pretty_names()output (“renter-occuiped”).
urbnindicators 0.0.0.9401
- Code-reviewed calculation of measures of error
- Code-reviewed calculations of derived measures
- Moved a number of functions from external to internal
- Removed
calculate_segregation_metrics(), which was not a clear fit within package’s scope at this time.
urbnindicators 0.0.0.9300
- Adding
make_pretty_names() - Reorganizing References
- Updating Getting Started vignette
- Removing Coefficients of Variation vignette until this functionality is more robust
- Updating README
- Adding
generate_codebook()andcalculate_cvs()(0.0.0.9100)