Learn R Programming

strataG (version 2.0.2)

structurePlot: Plot STRUCTURE Results

Description

Plot Q-matrix from a call to structure or clumpp.

Usage

structurePlot(q.mat, pop.col = 3, prob.col = 4, sort.probs = TRUE,
  label.pops = TRUE, col = NULL, horiz = TRUE, type = NULL,
  legend.position = c("top", "left", "right", "bottom", "none"))

Arguments

q.mat

matrix or data.frame of assignment probabilities.

pop.col

column number identifying original population designations.

prob.col

column number of first assignment probabilities to first group. It is assumed that the remainder of columns (prob.col:ncol(q.mat)) contain all assignment probabilities.

sort.probs

logical. Sort individuals by probabilities within populations? If FALSE individuals will be plotted as in q.mat.

label.pops

logical. Label the populations on the plot?

col

colors to use for each group.

horiz

logical. Plot bars horizontally.

type

either "area" for stacked continuous area plot or "bar" for discrete stacked bar chart. The latter is prefered for small numbers of samples. If not specified, a bar chart will be used if there are <= 100 samples.

legend.position

the position of the legend ("top", "left", "right", "bottom", or two-element numeric vector).

Value

invisibly, the ggplot object

See Also

structure, clumpp