Working with historic shapefiles
To ensure clean integration with the tidycensus package - which you'll learn about in the next chapter - tigris defaults to returning shapefiles that correspond to the year of the most recently-released ACS data. However, you may want boundary files for other years. tigris allows R users to obtain shapefiles for 1990, 2000, and 2010 through 2017, which represent many boundary changes over time. In this exercise, you'll use tigris to explore how Census tract boundaries have changed in Williamson County, Texas between 1990 and 2016.
Este exercício faz parte do curso
Analyzing US Census Data in R
Instruções do exercício
- Get a dataset of Census tracts for Williamson County in 1990.
- Request a Census tract dataset for Williamson County again, this time for 2016.
- Plot the geometry of both datasets to compare them.
Exercício interativo prático
Experimente este exercício completando este código de exemplo.
# Get a historic Census tract shapefile from 1990 for Williamson County, Texas
williamson90 <- ___(___ = "TX", county = "Williamson",
cb = TRUE, year = ___)
# Compare with a current dataset for 2016
williamson16 <- ___(state = "TX", ___ = "Williamson",
cb = TRUE, year = ___)
# Plot the geometry to compare the results
par(mfrow = c(1, 2))
plot(williamson90$___)
plot(___$geometry)