Skip to contents

Read tract and block group ("bg") geographies from the online Census TIGER/Line files into R

Usage

cincy_census_geo(
  geography = c("tract", "bg"),
  vintage = as.character(2024:2013)
)

cincy_county_geo(vintage = as.character(2024:2013))

Arguments

geography

which type of cincy census geography to return

vintage

a character vector of a year corresponding to the vintage of TIGER/Line data

Value

a simple features object with a geographic identifier column (geoid) and a geometry column (s2_geography)

Details

Compressed shapefiles are downloaded from TIGER into an R user data directory and will be cached for use across other R sessions (see ?dpkg::stow for more details).

Examples

cincy_census_geo("tract", "2024")
#> Simple feature collection with 226 features and 1 field
#> Geometry type: POLYGON
#> Dimension:     XY
#> Bounding box:  xmin: -84.8203 ymin: 39.02153 xmax: -84.25633 ymax: 39.31206
#> Geodetic CRS:  WGS 84
#> # A tibble: 226 × 2
#>    geoid                                                            s2_geography
#>    <chr>                                                           <POLYGON [°]>
#>  1 39061005500 ((-84.42289 39.16567, -84.42254 39.16555, -84.42218 39.16536, -8…
#>  2 39061005600 ((-84.40445 39.14973, -84.4044 39.14972, -84.40418 39.14971, -84…
#>  3 39061005701 ((-84.44668 39.18192, -84.44662 39.18191, -84.44618 39.18188, -8…
#>  4 39061005702 ((-84.44371 39.17402, -84.44366 39.17399, -84.44346 39.17392, -8…
#>  5 39061005800 ((-84.4205 39.18642, -84.42048 39.18625, -84.42044 39.18608, -84…
#>  6 39061006000 ((-84.49325 39.21023, -84.49295 39.21021, -84.49289 39.2102, -84…
#>  7 39061006100 ((-84.50064 39.19988, -84.5006 39.1998, -84.50055 39.19972, -84.…
#>  8 39061008100 ((-84.54627 39.18972, -84.5462 39.18916, -84.54617 39.189, -84.5…
#>  9 39061008601 ((-84.57115 39.13826, -84.56952 39.13816, -84.5696 39.13755, -84…
#> 10 39061006300 ((-84.47015 39.1679, -84.46856 39.1674, -84.46842 39.16736, -84.…
#> # ℹ 216 more rows
cincy_census_geo("bg", "2020")
#> Simple feature collection with 678 features and 1 field
#> Geometry type: POLYGON
#> Dimension:     XY
#> Bounding box:  xmin: -84.8203 ymin: 39.02153 xmax: -84.25633 ymax: 39.31206
#> Geodetic CRS:  WGS 84
#> # A tibble: 678 × 2
#>    geoid                                                            s2_geography
#>    <chr>                                                           <POLYGON [°]>
#>  1 390610234002 ((-84.44907 39.18265, -84.44782 39.1826, -84.44663 39.18253, -8…
#>  2 390610233003 ((-84.45327 39.19248, -84.45189 39.19238, -84.44937 39.19221, -…
#>  3 390610239023 ((-84.36462 39.23666, -84.35873 39.23576, -84.359 39.23292, -84…
#>  4 390610234001 ((-84.45455 39.18374, -84.45453 39.18351, -84.45451 39.18331, -…
#>  5 390610232103 ((-84.42632 39.21717, -84.42624 39.21714, -84.42566 39.21705, -…
#>  6 390610235225 ((-84.37768 39.22546, -84.37679 39.22557, -84.37626 39.22564, -…
#>  7 390610236001 ((-84.39897 39.20947, -84.39885 39.20947, -84.39546 39.20917, -…
#>  8 390610236003 ((-84.40499 39.21031, -84.40497 39.21022, -84.40494 39.21014, -…
#>  9 390610236004 ((-84.42186 39.21725, -84.42111 39.21723, -84.41939 39.21719, -…
#> 10 390610237011 ((-84.39489 39.20311, -84.3915 39.2028, -84.38788 39.20249, -84…
#> # ℹ 668 more rows
cincy_county_geo("2024")
#> <geodesic s2_geography[1] with CRS=OGC:CRS84>
#> [1] POLYGON ((-84.51305 39.304795, -84.514284 39.304614, -84.514574 39.304572, -84.516703 39.30426, -84.517011 39.304215...