<p>I am excited to announce that <strong>tigris</strong> 0.5 is now on CRAN. This is a major release that has been in the works for several months. Get it with <code>install.packages(&quot;tigris&quot;)</code>.</p>
<p>One major new feature is support for the simple features data model via the <a href="https://github.com/edzer/sfr">sf R package</a>. <strong>sf</strong> allows for the representation of spatial objects in R like data frames, but with a list-column containing feature geometry. This has multiple advantages, as objects of class <code>sf</code> accept <strong>tidyverse</strong> functions for data wrangling and are much faster to work with. For <strong>tigris</strong>, this means that large objects like Census blocks or national railroads are much more usable in R.</p>
<p>To return an object of class <code>sf</code> via <strong>tigris</strong>, either supply the argument <code>class = &quot;sf&quot;</code> or set this globally in your R session with <code>options(tigris_class = &quot;sf&quot;)</code>. For example:</p>
<pre><code>library(tigris)

options(tigris_class = &quot;sf&quot;)

co &lt;- counties(cb = TRUE)

head(co)</code></pre>
<pre><code>## Simple feature collection with 6 features and 9 fields
## geometry type:  MULTIPOLYGON
## dimension:      XY
## bbox:           xmin: -88.47323 ymin: 31.18113 xmax: -85.04931 ymax: 33.00682
## epsg (SRID):    4269
## proj4string:    +proj=longlat +datum=NAD83 +no_defs
##   STATEFP COUNTYFP COUNTYNS       AFFGEOID GEOID    NAME LSAD      ALAND
## 1      01      005 00161528 0500000US01005 01005 Barbour   06 2291820706
## 2      01      023 00161537 0500000US01023 01023 Choctaw   06 2365954971
## 3      01      035 00161543 0500000US01035 01035 Conecuh   06 2201896058
## 4      01      051 00161551 0500000US01051 01051  Elmore   06 1601876535
## 5      01      065 00161558 0500000US01065 01065    Hale   06 1667804583
## 6      01      109 00161581 0500000US01109 01109    Pike   06 1740741211
##     AWATER                       geometry
## 1 50864677 MULTIPOLYGON(((-85.748032 3...
## 2 19059247 MULTIPOLYGON(((-88.473227 3...
## 3  6643480 MULTIPOLYGON(((-87.427204 3...
## 4 99850740 MULTIPOLYGON(((-86.413335 3...
## 5 32525874 MULTIPOLYGON(((-87.870464 3...
## 6  2336975 MULTIPOLYGON(((-86.199408 3...</code></pre>
<p><code>geo_join</code> and <code>rbind_tigris</code> still work with objects of class <code>sf</code>; however, you can use the <code>*_join</code> functions from the tidyverse as well.</p>
<p>The second major new feature is support for historic shapefiles going back to 1990. Historical data are available for the <code>states()</code>, <code>counties()</code>, <code>tracts()</code>, and <code>block_groups()</code> functions, and I’ve re-factored much of <strong>tigris</strong>’s code to easily accommodate other geographies if requested by users.</p>
<pre><code>library(purrr)

options(tigris_class = &quot;sp&quot;)

par(mfrow = c(1, 3))

walk(c(1990, 2000, 2010), function(year) {
  plot(tracts(&quot;TX&quot;, &quot;Denton&quot;, cb = TRUE, year = year), 
       main = paste0(&quot;Census tracts in Denton County, &quot;, 
                     as.character(year)))
})</code></pre>
<p></p>
<p>My motivation for these updates is twofold. First, I’m working on a new package called <strong>tidycensus</strong> that will integrate <strong>tigris</strong> with the decennial Census and American Community Survey APIs. This package will allow R users to return integrated spatial and demographic datasets as <code>sf</code> objects in one function call, and will be designed to work seamlessly within the tidyverse. Second, I’m starting a book project this summer called Analyzing the US Census with R. The book will cover Census data acquisition and wrangling; spatial modeling with Census data; and working with Census microdata from the <a href="https://www.ipums.org/">Integrated Public Use Microdata Series</a>, all within R. Look for updates on both projects in this space!</p>