R/admixture.plot.R

Defines functions admixture.plot

Documented in admixture.plot

#' @title Admixture Barplot
#' @description Generate a barplot for admixture output (.Q file).
#' @usage admixture(file.Q, col = rainbow(3), xlab = "Individual #", ylab = "Ancestry", border = NA, ...)
#' @param file.Q Character vector. Admixture output file name (ending with .Q)
#' @param ... Graphical parameters
#' @return Admixture barplot
#' @author CainĂ£ Max Couto-Silva.
#' @export

admixture.plot <- function(file.Q, col = rainbow(3), xlab = "Individual #", ylab = "Ancestry", border = NA, ...) {
  file.Q <- t(as.matrix(read.table(file.Q)))
  barplot(file.Q, col = rainbow(3), xlab = xlab, ylab = ylab, border = border, ...)
}
cmcouto-silva/gt documentation built on June 6, 2021, 7:14 p.m.