From Demographic Data to Demographic Plots

Desire De Waele
July 19, 2016

From Data ...

The counties dataframe contains the demographic percentages of four races in the USA, per county. This application visualizes the data, and lets the user explore the data on its own. Here, the top of our dataset is shown to see the starting point.

counties <- readRDS("ShinyApp/data/counties.rds")
# Top four rows, second column is irrelevant
counties[1:4,-2]
             name white black hispanic asian
1 alabama,autauga  77.2  19.3      2.4   0.9
2 alabama,baldwin  83.5  10.9      4.4   0.7
3 alabama,barbour  46.8  47.8      5.1   0.4
4    alabama,bibb  75.0  22.9      1.8   0.1

... to Plots

The ending point is our Shiny application. This is a screenshot. A selector lets the user choose a race, a slider can change the lower and upper percentages to be shown. The result is a demographic plot of the USA.

alt text

White Demographics

This is an example of the demographics of the white population. A base level of 60% is chosen to get a smoother distribution. In general, the majority of the population is white.

percent_map(var = counties$white, color = "darkblue", legend.title = "% White", min = 60)

plot of chunk unnamed-chunk-3

African-American Demographics

This is an example of the demographics of the African-American population. The African-American population is clearly centered in the southern and eastern states.

percent_map(var = counties$black, color = "black", legend.title = "% Black", max = 60)

plot of chunk unnamed-chunk-4