Session Ready
Exercise

Getting Census data with tidycensus

In this exercise, you will load and inspect data from the 2010 US Census and 2012-2016 American Community Survey. The core functions of get_decennial() and get_acs() in tidycensus are used to obtain data from these sources; the 2010 Census and 2012-2016 ACS are the defaults for these functions, respectively.

By inspecting the data, you'll get a sense of differences between decennial US Census data and data from the ACS, which is based on a sample and subject to a margin of error. Whereas get_decennial() returns a data value for each row, get_acs() returns estimate and moe columns representing the ACS estimate and margin of error.

Instructions 1/2
undefined XP
  • 1

    Obtain a dataset of state populations using get_decennial() and view it with head().

    • 2

      Obtain a dataset of median household income by state using get_acs() and view it with head().