Analysts across industries rely on data from the United States Census Bureau in their work. In this course, students will learn how to work with Census tabular and spatial data in the R environment. The course focuses on the tidycensus package for acquiring data from the decennial US Census and American Community survey in a tidyverse-friendly format, and the tigris package for accessing Census geographic data within R. By the end of this course, students will be able to rapidly visualize and explore demographic data from the Census Bureau using ggplot2 and other tidyverse tools, and make maps of Census demographic data with only a few lines of R code.
Census data in R with tidycensusFree
In this chapter, students will learn the basics of working with Census data in R with tidycensus. They will acquire data using tidycensus functions, search for data, and make a basic plot.Census data in R: an overview50 xpObtain and set your Census API key100 xpGetting Census data with tidycensus100 xpBasic tidycensus functionality50 xpUnderstanding tidycensus options100 xpTidy and wide data in tidycensus100 xpSearching for data with tidycensus50 xpLoading variables in tidycensus100 xpExploring variables with tidyverse tools100 xpVisualizing Census data with ggplot250 xpComparing geographies with ggplot2 visualizations100 xpCustomizing ggplot2 visualizations of ACS data100 xp
Wrangling US Census Data
In this chapter, students learn how to use tidyverse tools to wrangle data from the US Census and American Community Survey. They also learn about handling margins of error in the ACS.Tables and summary variables in tidycensus50 xpDownload and view a table of data from the ACS100 xpGet a summary variable and calculate percentages100 xpCensus data wrangling with tidy tools50 xpFinding the largest group by county100 xpRecoding variables and calculating group sums100 xpComparing ACS estimates for multiple years100 xpWorking with margins of error in tidycensus50 xpInspecting margins of error100 xpUsing margin of error functions in tidycensus100 xpCalculating group-wise margins of error100 xpVisualizing margins of error from the ACS50 xpQuick visual exploration of ACS margins of error100 xpCustomizing a ggplot2 margin of error plot100 xp
US Census geographic data in R
In this chapter, students will learn how to work with US Census Bureau geographic data in R using the tigris R package.Understanding census geography and tigris basics50 xpGetting Census boundary files with tigris100 xpGetting geographic features with tigris100 xpUnderstanding the structure of tigris objects100 xpCustomizing tigris options50 xpTIGER/Line and cartographic boundary files100 xpGetting data as simple features objects100 xpSetting a cache directory100 xpWorking with historic shapefiles100 xpCombining and joining census geographic datasets50 xpCombining datasets of the same tigris type100 xpGetting data for multiple states100 xpJoining data from an external data frame100 xpPlotting data with tigris and ggplot250 xpPlotting simple features with geom_sf()100 xpCustomizing geom_sf() plots100 xp
Mapping US Census Data
In this chapter, you will learn how to obtain feature geometry with the tidycensus package, and use ggplot2 and mapview to make customized static and interactive maps of US Census data.Simple feature geometry and tidycensus50 xpGetting simple feature geometry100 xpJoining data from tigris and tidycensus100 xpShifting Alaska and Hawaii geometry100 xpMapping demographic data with ggplot250 xpMaking a choropleth map100 xpModifying map colors100 xpCustomizing the map output100 xpAdvanced demographic mapping50 xpGraduated symbol maps100 xpFaceted maps with ggplot2100 xpInteractive visualization with mapview100 xpCartographic workflows with tigris and tidycensus50 xpGenerating random dots with sf100 xpObtaining data for cartography with tigris100 xpMaking a dot-density map with ggplot2100 xpNext steps for working with demographic data in R50 xp
Kyle WalkerSee More
Geography professor at TCU and spatial data science consultant
I work as a geography professor at TCU and as a spatial data science consultant. My research focuses on demographic change and migration in US cities and suburbs; demographic data visualization; and tools for open data science. I'm also the author of the tidycensus, tigris, and idbr R packages for working with US Census Bureau data.