1. Learn
  2. /
  3. Courses
  4. /
  5. Analyzing US Census Data in R

Exercise

Understanding tidycensus options

As discussed in this lesson, Census data comprise thousands of variables available across dozens of geographies! Most of these geography-variable combinations are accessible with tidycensus; however, it helps to understand the package options.

Some data, like Census tracts, are only available by state, and users might want to subset by county; tidycensus facilitates this with state and county parameters when appropriate. Additionally, tidycensus includes the Census variable ID in the variable column; however, a user might want to supply her own variable name, which can be accomplished with a named vector.

You'll be using the Census variable B19013_001 here, which refers to median household income.

Instructions 1/3

undefined XP
  • 1

    Get a dataset of median household income by Census tract for Texas by using the state parameter.

  • 2

    Get the same dataset, but specifically for Travis County, with the county parameter by specifying "Travis".

  • 3

    Use a named vector to set the values in the variable column to hhincome.