Getting simple feature geometry

tidycensus can obtain simple feature geometry for many geographies by adding the argument geometry = TRUE. In this exercise, you'll obtain a dataset of median housing values for owner-occupied units by Census tract in Orange County, California with simple feature geometry included.

This exercise is part of the course

Analyzing US Census Data in R

View Course

Exercise instructions

  • Use the get_acs() function to get a dataset of median owner-occupied housing value by Census tract.
  • Set geometry = TRUE to request Census tract simple feature geometry.
  • Plot the estimate to view a map of the data.

Hands-on interactive exercise

Have a go at this exercise by completing this sample code.

library(tidycensus)
library(tidyverse)
library(sf)

# Get dataset with geometry set to TRUE
orange_value <- ___(___ = "tract", state = "CA", 
                    county = "Orange", 
                    ___ = "B25077_001", 
                    ___ = TRUE)

# Plot the estimate to view a map of the data
___(orange_value["estimate"])