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

Connected

Exercise

Obtain and set your Census API key

tidycensus is an R package designed to return data from the US Census Bureau ready for use within the Tidyverse.

To acquire data from the US Census Bureau using the tidycensus R package, you must first acquire and set a Census API key. After obtaining your key, you can install it for future use with the census_api_key() function in tidycensus.

This exercise uses a fake API key for purposes of illustration.

Instructions

100 XP
  • Load the tidycensus package into your DataCamp R session.
  • Set the Census API key with census_api_key().
  • Check your API key with Sys.getenv().