First, you need to obtain an API key — it’s quick and easy. Go here, fill in the short form, and they’ll give you one immediately. You need to plug in your API key where you see XXXXXX below.
To find variables of interest, I recommend the Census website’s advanced search.
require(tidycensus) require(tidyverse) require(viridis) # Plug in your API key where the X's are; then uncomment that line. # census_api_key("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") ################################# ## Using the tidycensus package ################################# us.