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.
Latihan ini adalah bagian dari kursus
Analyzing US Census Data in R
Petunjuk latihan
- Use the
get_acs()function to get a dataset of median owner-occupied housing value by Census tract. - Set
geometry = TRUEto request Census tract simple feature geometry. - Plot the estimate to view a map of the data.
Latihan interaktif praktis
Cobalah latihan ini dengan menyelesaikan kode contoh berikut.
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"])