grunwaldlab / Population_Genetics_in_R

A primer for computational tools to analyze genetics of populations in R
http://grunwaldlab.github.io/Population_Genetics_in_R
Other
84 stars 50 forks source link

Succinctly explain what new function does. #2

Closed zkamvar closed 9 years ago

zkamvar commented 9 years ago

in Chapter 5, explain what the following function is doing before introducing it. It is not "simple".

plot_simp_diff <- function(pop_name, mcc_TY, monpop){
  cc <- locus_table(mcc_TY, pop = pop_name, info = FALSE)
  mp <- locus_table(monpop, pop = pop_name, info = FALSE)
  res <- mp - cc
  barplot(res[, "1-D"], main = pop_name)
}