Skip to contents

Census block-level weights are used to spatially interpolate CoDEC data packages from the census tract-level to other Cincy geographies.

Usage

codec_interpolate(from, to, weights = c("pop", "homes", "area"))

Arguments

from

a CoDEC data package

to

A simple features object returned by one of the cincy_*_geo() functions (i.e., cincy_census_geo(), cincy_neighborhood_geo(), or cincy_zcta_geo()`)

weights

which census block-level weights to use; see details

Value

a tibble with a new geographic identifier column for the to target geography (geoid) in addition to the (interpolated) columns in from

Details

Block-level total population (pop), total number of homes (homes), or total land area (area) from the 2020 Census can be chosen to use for the weights. Geospatial intersection happens after transforming geographies to epsg:5072. See codec_as_sf() for adding geography to a CoDEC data package. Variables beginning with "n_" are interpolated using a weighted sum; all other variables are interpolated using a weighted mean.

Examples

codec_interpolate(get_codec_dpkg("acs_measures-v0.1.0"),
                  cincy_neighborhood_geo())
#> # A tibble: 51 × 24
#>    geoid              year median_home_value prop_poverty prop_recieved_public…¹
#>    <chr>             <dbl>             <dbl>        <dbl>                  <dbl>
#>  1 Avondale           2022           186638.       0.436                  0.380 
#>  2 Bond Hill          2022           156866.       0.194                  0.154 
#>  3 CUF                2022           191368.       0.462                  0.0528
#>  4 California         2022           597200        0.0523                 0.0274
#>  5 Camp Washington    2022           100000        0.272                  0.253 
#>  6 Carthage           2022            90500        0.173                  0.277 
#>  7 Clifton            2022           384430.       0.150                  0.0704
#>  8 College Hill       2022           148486.       0.197                  0.180 
#>  9 Columbia Tusculum  2022           412000        0.0366                 0.0498
#> 10 Corryville         2022           200113.       0.523                  0.0393
#> # ℹ 41 more rows
#> # ℹ abbreviated name: ¹​prop_recieved_public_assistance_income
#> # ℹ 19 more variables: prop_family_households_with_single_householder <dbl>,
#> #   prop_employment_among_civilian_workforce <dbl>,
#> #   prop_housing_units_occupied_by_renters <dbl>,
#> #   prop_median_rent_to_income_ratio_among_renters <dbl>,
#> #   prop_housing_units_vacant <dbl>, …
codec_interpolate(get_codec_dpkg("property_code_enforcements-v0.2.0"),
                  cincy_census_geo("tract", "2020"))
#> # A tibble: 5,876 × 6
#>    geoid        year month violations_per_addr n_violations n_addr
#>    <chr>       <dbl> <dbl>               <dbl>        <dbl>  <dbl>
#>  1 39061000200  1999  10.5            NaN                 0      0
#>  2 39061000200  2000   6.5            NaN                 0      0
#>  3 39061000200  2001   6.5              0.0105            1     95
#>  4 39061000200  2002   6.5              0.0118            9    760
#>  5 39061000200  2003   6.5              0.0274           13    475
#>  6 39061000200  2004   6.5              0.0105            1     95
#>  7 39061000200  2005   6.5              0.0105            2    190
#>  8 39061000200  2006   6.5              0.0132            5    380
#>  9 39061000200  2007   6.5              0.0105            4    380
#> 10 39061000200  2008   6.5              0.0947           45    475
#> # ℹ 5,866 more rows