This data was collected by Alice B. Popejoy, and Stephanie M. Fullerton in 2016.They used sample descriptions imbedded in the GWAS Catalog.In 2016, they recreated this process to analyze and observe the myriad of variation of diversity amongst the participants.Using this data they can compare the data from both years (2016 and 2009)
## Create data
data2009 <- c(96,3,1)
labelsOfData <- c("European\n","\n\nAsian","\nNon-Europeanan")
data2016 <- c(81,14,5)
# 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(data2009, labels = labelsOfData, main = "2009", init.angle = -82, radius = 1, col = c(22,1,8))
# pie graph 2
# add main, init.angle, radius, and col
pie(data2016, labels = labelsOfData, main = "2016", init.angle = -57, radius = 1, col = c(22,1,8))
# 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)