開始使用免費開始

使用 ggplot2 視覺化比較地理區域

在探索 Census 或 ACS 資料時,你常會想知道不同地理單位之間的差異。例如:哪些美國州的家庭所得中位數較高,哪些較低?你可以用視覺化來完成這件事,特別是使用「點圖」(dot plots),在呈現排序上特別有效。在這個練習中,你會使用熱門的 ggplot2 資料視覺化套件來完成這項任務。

本練習屬於課程

在 R 中分析美國人口普查資料

檢視課程

動手互動練習

試著完成這個範例程式碼,體驗一下這個練習。

# Access the 1-year ACS  with the survey parameter
ne_income <- ___(geography = "state",
                     variables = "B19013_001", 
                     ___ = "acs1", 
                     state = c("ME", "NH", "VT", "MA", 
                               "RI", "CT", "NY"))
編輯並執行程式碼