Introduction

This data was collected through a GWAS census, the data was hand picked by Alice B. Popejoy and Stephanie M. Fullerton. The data was collected by sampling around 3.5 million peoples from around the world. This process was repeated because the first study in 2009 was vastly only of European decent and it became necessary that other demographics needed to be studied. The plots will include both studie and demonstrate the difference in levels of demographic.

Create data

#2009
data2009<-c(96, 3, 1)
labels1<-c("European ancestry\n","\nAsian\t\n","\nOther non-european")

#2016
data2016<-c(81, 14, 5)
labels2<-c("European ancestry\n","\nAsian","\nOther non-european")

Pie graphs

# set up par()
par(mfrow = c(1,2), mar = c(2,3,1,5))

#pie graphs 1
# add main, init.angle, radius, and col
pie(x = data2009, labels = labels1, main = "2009", init.angle = 280, radius = .4, col = c(4, 7, 2))

# pie graph 2
# add main, init.angle, radius, and col
pie(x = data2016, labels = labels2, main = "2016", init.angle = 300, radius = .4,  col = c(7, 3, 6))

Bar graphs

# data
dat2016 <- c(14, 3,1,0.54,0.28,0.08,0.05)
dat2016_rev <- rev(dat2016)
barplotdata2016 <- matrix(c(dat2016_rev))

# labels
labels_x <- rev(c("Asian","African","Mixed", "Hispanic &\nLatin American",
                        "Pacific Islander","Arab & Middle East","Native peoples"))

par(mfrow = c(1,1))

barplot(barplotdata2016,
        width = 0.01, 
        xlim = c(0,0.1),
         axes = F,
        col = c(1,2,3,4,5,6,7),
        legend.text = labels_x)