Using tinytiger

tinytiger is designed to be low dependency to allow packages and newer R users to use TIGER lines and shapefiles without accruing non-standard dependencies. It has four dependencies: - sf, needed to work with shapefiles - curl, needed for downloading the files from the Census Bureau - cli, used to create clear errors, warnings, and messages. - glue, used for constructing complex URLs and already a dependency of cli

While cli is not necessary, it fits within our goals that tinytiger to be friendly for package development and new users, as cli is one of the most-widely downloaded R packages and comes with but one dependency itself.

Using tinytiger

library(tinytiger)

tinytiger has methods to download TIGER shapes for most Census geographies. A full list are available on the tinytiger website.

To download any shapes, we can use the corresponding function for the geography. All functions are prefixed with tt_.

For counties, for example, we can run:

counties <- tt_counties()
head(counties)
#> Simple feature collection with 6 features and 17 fields
#> Geometry type: MULTIPOLYGON
#> Dimension:     XY
#> Bounding box:  xmin: -123.7283 ymin: 18.11774 xmax: -65.81565 ymax: 46.38562
#> Geodetic CRS:  NAD83
#> # A tibble: 6 × 18
#>   STATEFP COUNTYFP COUNTYNS GEOID NAME        NAMELSAD LSAD  CLASSFP MTFCC CSAFP
#>   <chr>   <chr>    <chr>    <chr> <chr>       <chr>    <chr> <chr>   <chr> <chr>
#> 1 31      039      00835841 31039 Cuming      Cuming … 06    H1      G4020 <NA> 
#> 2 53      069      01513275 53069 Wahkiakum   Wahkiak… 06    H1      G4020 <NA> 
#> 3 35      011      00933054 35011 De Baca     De Baca… 06    H1      G4020 <NA> 
#> 4 31      109      00835876 31109 Lancaster   Lancast… 06    H1      G4020 <NA> 
#> 5 31      129      00835886 31129 Nuckolls    Nuckoll… 06    H1      G4020 <NA> 
#> 6 72      085      01804523 72085 Las Piedras Las Pie… 13    H1      G4020 <NA> 
#> # ℹ 8 more variables: CBSAFP <chr>, METDIVFP <chr>, FUNCSTAT <chr>,
#> #   ALAND <dbl>, AWATER <dbl>, INTPTLAT <chr>, INTPTLON <chr>,
#> #   geometry <MULTIPOLYGON [°]>

Other options for downloads are: