Introduction

The pie graphs show the proportion of races of people used in genomic studies. The data was collected by the Genomic-Wide Association Studies. It was collected by analyzing sample descriptions included in the GWAS Catalog. The process was repeated in 2016 to see if there was any change in the proportion of races of people used in genomic studies.

Create data

piegraph2016<-c(81,14,5)
piegraph2009<-c(96, 3, 1)
labels2016<-c("European ancestry","Asian","Other non-European")
labels2009<-c("European ancestry","Asian","Other 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(piegraph2009, labels = labels2009, main = "2009 Pie Graph", init.angle = -82, radius = 1, col = c(1,2,3))

# pie graph 2
# add main, init.angle, radius, and col
pie(piegraph2016, labels = labels2016, main = "2016 Pie Graph", init.angle = -82, radius = 1, col = c(1,2,3))

Bar graphs

If you want, you can examine this code below to see how stracked bar graphs are made

# 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)