Introduction

Write a brief introduction about the data being plotted, including the information

###The data being plotted was collected by Alice B Popejoy and Stephanie M. Fullerton to show how current genomic studies are biased toward people of European descent and how there are large populations of the world that do not have access to the same “precision medicine” as many have access to. The study in 2009 analyzed genome-wide association studies(GWAS) and the participants of the studies. They found that 96% of participants wer of European descent. The study was re-done in 2016 to see if there would be a greater diversity among cultures involved in GWAS. There was a 2000% increase in sample numbers from 2009 to 2016 and the data showed a greater diversity in participants in the 2016 study.

Create data

Create vectors to contain the data and labels to make the pie graphs at the top of figures.

Each vector has 3 elements: European ancestry, Asian ancestry, and other non-European ancestry.

DO NOT name your vector for the labels “labels”, since this is the name of an existing R function.

Include new line characters in the text as needed to improve spacing.

euro_non_euro <- c(96, 3, 1)
euro_non_euro2 <- c(81, 14, 5)

labels1<-c("European ancestry","Non-European ancestry")

euro_non_euroLAB <- c("European","Asian","Other non-European")

labels2<-c("European ancestry","Asian","Other non-European")

Pie graphs

  1. Create a 1 x 2 grid using the command par(mfrow = c(1,2))
  2. Plot the 2009 data on the left and 2016 data on the right.
  3. This will require setting up the pie command twomce
  4. Use the argument main = … to add a title to above the plots
  5. Set the argument init.angle = … to -82. Experiment with how this affects the plot.
  6. Set the argument radius = … to 1. Experiment with how this affects the plot.
  7. Set the argument col = … to c(1,2,3), then experiment with different numbers. Try to make it ugly.
par(mfrow = c(1,2), mar = c(2,3,1,5))

pie(x = euro_non_euro, euro_non_euroLAB,  main = 2009, init.angle = -82, radius = 1, col = c(1,2,3))

pie(x = euro_non_euro2, euro_non_euroLAB, main = 2016, init.angle = -82, radius = 1, col = c(1,2,3))

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)