The data is about proportion of participants of GWAS. They are collected by Alice B. Popejoy and Stephanie M. Fullerton with the GWAS Catalog. They collected the data of 2009 and 2016 to see the change and how certain groups are underrepresented.
Euro_asian_other_2009<-c(96,3,1)
countries_labels<-c("European\nancestry","Asian\nancestry","Non-European\nancestry")
Euro_asian_other_2016<-c(81,14,05)
the second chart is so ugly! color 1 and 9 are too close and can be hardly identified
# 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(Euro_asian_other_2009,main = "2009 Study",labels =countries_labels,radius=1,init.angle = -82,col = c(1,2,3) )
# pie graph 2
# add main, init.angle, radius, and col
pie(Euro_asian_other_2016,main = "2016 Study",labels =countries_labels,radius=1,init.angle = -82,col = c(1,2,9))
# 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)