structurePlot: Plot STRUCTURE Results

Description Usage Arguments Value Author(s) See Also

View source: R/structurePlot.R

Description

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

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
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"),
  plot = TRUE
)

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).

plot

display plot?

Value

invisibly, the ggplot object

Author(s)

Eric Archer eric.archer@noaa.gov

See Also

structure, clumpp


strataG documentation built on Feb. 28, 2020, 9:07 a.m.