Learn R Programming

starmie (version 0.1.2)

plotTreeBar: Generate a barplot of a Structure or Admixture run.

Description

Generate a barplot of a Structure or Admixture run.

Usage

plotTreeBar(x, facet = TRUE, dendro = NULL, cut = NULL)

Arguments

x
a single cluster run object of type struct or admix or Q-matrix
facet
whether or not to split the barplot by cluster. This is recommended.
dendro
an object of class 'hclust' (defaults to hclust with average linkage)
cut
an integer vector output by 'cutree' (defaults to cutree k=ncols(Q))

Examples

Run this code
# Read file using K = 6 and plot results
k6_data <- exampleStructure("barplot")
# our facetted structure plot with tree
plotTreeBar(k6_data)
# standard 'structure' bar plot with tree
plotTreeBar(k6_data, facet = FALSE)
# Admix example
k3_data <- exampleAdmixture()[[3]]
plotTreeBar(k3_data)

Run the code above in your browser using DataLab