Making a choropleth map
Choropleth maps, which visualize statistical variation through the shading of areas, are among the most popular ways to map demographic data. Census or ACS data acquired with tidycensus can be mapped in this way in ggplot2 with geom_sf using the estimate column as a fill aesthetic. In this exercise, you'll make a choropleth map with ggplot2 of median owner-occupied home values by Census tract for Marin County, California.
แบบฝึกหัดนี้เป็นส่วนหนึ่งของหลักสูตร
Analyzing US Census Data in R
คำแนะนำการฝึกหัด
- Initialize the ggplot object.
- Set the polygon fill to the
estimatecolumn. - Map your data with
geom_sf().
แบบฝึกหัดเชิงโต้ตอบแบบลงมือทำ
ลองทำแบบฝึกหัดนี้โดยเติมโค้ดตัวอย่างนี้ให้สมบูรณ์
library(ggplot2)
# Create a choropleth map with ggplot
___(marin_value, aes(___ = ___)) +
___()