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("tract", "2020")
#> Simple feature collection with 226 features and 1 field
#> Geometry type: MULTIPOLYGON
#> 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>                                                      <MULTIPOLYGON [°]>
#>  1 39061005200 (((-84.44284 39.14481, -84.44274 39.1448, -84.44126 39.14469, -8…
#>  2 39061026200 (((-84.82018 39.12086, -84.82015 39.12061, -84.82013 39.12041, -…
#>  3 39061023901 (((-84.36623 39.2497, -84.36565 39.24954, -84.36539 39.24947, -8…
#>  4 39061023701 (((-84.4088 39.20398, -84.40861 39.20397, -84.40654 39.20382, -8…
#>  5 39061010500 (((-84.69515 39.11356, -84.69376 39.11198, -84.69068 39.10849, -…
#>  6 39061020501 (((-84.71736 39.24415, -84.7171 39.24294, -84.71647 39.24154, -8…
#>  7 39061021900 (((-84.57231 39.20906, -84.57206 39.2088, -84.57038 39.20708, -8…
#>  8 39061021102 (((-84.69025 39.12426, -84.68968 39.12428, -84.68907 39.1242, -8…
#>  9 39061003700 (((-84.49035 39.12595, -84.4881 39.1258, -84.4879 39.12578, -84.…
#> 10 39061003800 (((-84.48376 39.14202, -84.48368 39.14177, -84.48359 39.14158, -…
#> # ℹ 216 more rows
cincy_census_geo("tract", "2019")
#> Simple feature collection with 222 features and 1 field
#> Geometry type: MULTIPOLYGON
#> Dimension:     XY
#> Bounding box:  xmin: -84.8203 ymin: 39.02153 xmax: -84.25624 ymax: 39.31206
#> Geodetic CRS:  WGS 84
#> # A tibble: 222 × 2
#>    geoid                                                            s2_geography
#>    <chr>                                                      <MULTIPOLYGON [°]>
#>  1 39061021602 (((-84.54739 39.24984, -84.54736 39.24981, -84.54729 39.24971, -…
#>  2 39061021603 (((-84.57494 39.24313, -84.57458 39.24312, -84.57287 39.24305, -…
#>  3 39061021604 (((-84.57678 39.23776, -84.57653 39.23703, -84.57648 39.23687, -…
#>  4 39061021701 (((-84.56273 39.23345, -84.56182 39.23339, -84.55959 39.23325, -…
#>  5 39061021702 (((-84.5488 39.22564, -84.54831 39.22557, -84.5479 39.22551, -84…
#>  6 39061021801 (((-84.56108 39.21856, -84.55991 39.21848, -84.55993 39.21822, -…
#>  7 39061005000 (((-84.45687 39.14009, -84.45686 39.13978, -84.45671 39.13903, -…
#>  8 39061005100 (((-84.43415 39.13698, -84.43325 39.13693, -84.43209 39.13686, -…
#>  9 39061008000 (((-84.52412 39.18866, -84.52411 39.18834, -84.52407 39.18799, -…
#> 10 39061005400 (((-84.43704 39.15901, -84.43295 39.15779, -84.43269 39.15773, -…
#> # ℹ 212 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.21716, -84.42624 39.21714, -84.42566 39.21705, -…
#>  6 390610235225 ((-84.37768 39.22546, -84.37679 39.22557, -84.37626 39.22565, -…
#>  7 390610236001 ((-84.39897 39.20947, -84.39885 39.20947, -84.39546 39.20917, -…
#>  8 390610236003 ((-84.40499 39.21032, -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_census_geo("bg", "2019")
#> Simple feature collection with 697 features and 1 field
#> Geometry type: MULTIPOLYGON
#> Dimension:     XY
#> Bounding box:  xmin: -84.8203 ymin: 39.02153 xmax: -84.25624 ymax: 39.31206
#> Geodetic CRS:  WGS 84
#> # A tibble: 697 × 2
#>    geoid                                                            s2_geography
#>    <chr>                                                      <MULTIPOLYGON [°]>
#>  1 390610079002 (((-84.5597 39.17097, -84.55957 39.17057, -84.55924 39.17022, -…
#>  2 390610078003 (((-84.55147 39.16224, -84.55146 39.16219, -84.55108 39.16125, …
#>  3 390610079001 (((-84.54823 39.1676, -84.54787 39.16754, -84.54739 39.16739, -…
#>  4 390610252004 (((-84.45982 39.16796, -84.45892 39.16791, -84.45804 39.16786, …
#>  5 390610255003 (((-84.46774 39.16331, -84.46754 39.16296, -84.46707 39.16213, …
#>  6 390610261013 (((-84.8201 39.2515, -84.81879 39.25083, -84.81764 39.25023, -8…
#>  7 390610263001 (((-84.5456 39.10343, -84.54554 39.10328, -84.54535 39.10304, -…
#>  8 390610002001 (((-84.53178 39.11373, -84.53169 39.11351, -84.53163 39.11334, …
#>  9 390610264001 (((-84.52775 39.10929, -84.52671 39.10922, -84.5254 39.10915, -…
#> 10 390610264002 (((-84.5282 39.10569, -84.5258 39.10554, -84.52484 39.10548, -8…
#> # ℹ 687 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...