我一直在使用一些 tidycensus 数据进行分配,并且已经到了尝试生成平滑线图并没有绘制我的数据集的地步。
我目前的代码是:
PA_county_list %>%
filter(county %in% c("Chester County","Bucks County")) %>%
ggplot() +
geom_smooth(mapping = aes (x = total.pop , y = mean.white, color = county)) +
labs(title = "Comparing Percent White Race in Chester County and Buck County",
subtitle = "2010 ACS 5 year census survey",
y = "White Race Claims",
x = "Total Population")
这是我正在使用的数据示例:
county total.pop mean.white mean.income per_white
<chr> <dbl> <dbl> <dbl> <dbl>
Chester County 41413 3694.957 88997.22 3.716587
Bucks County 47969 3946.140 79940.48 3.969241
打印脚本的结果导致标记为空白图。其中标签完好无损,但未列出来自total.pop
(人口)和mean.white
(白人种族)的数据。
在这一点上,任何见解将不胜感激。
谢谢。