取得 simple feature 幾何
tidycensus 可以透過加入引數 geometry = TRUE,為多種地理區劃取得 simple feature 幾何。在這個練習中,你將取得加州橘郡(Orange County)普查分區(Census tract)層級、屋主自住單位的房價中位數資料,並包含 simple feature 幾何。
本練習屬於課程
在 R 中分析美國人口普查資料
練習說明
- 使用
get_acs()函式,依普查分區取得屋主自住房屋價值的中位數資料。 - 設定
geometry = TRUE以請求普查分區的 simple feature 幾何。 - 繪製估計值,以檢視資料的地圖。
動手互動練習
試著完成這個範例程式碼,體驗一下這個練習。
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"])