For gt_dapc, the following types of plots are available:

  • screeplot: a plot of the eigenvalues of the discriminant axes

  • scores a scatterplot of the scores of each individual on two discriminant axes (defined by ld)

  • loadings a plot of loadings of all loci for a discriminant axis (chosen with ld)

  • components a bar plot showing the probability of assignment to each cluster

# S3 method for class 'gt_dapc'
autoplot(
  object,
  type = c("screeplot", "scores", "loadings", "components"),
  ld = NULL,
  group = NULL,
  n_col = 1,
  ...
)

Arguments

object

an object of class gt_dapc

type

the type of plot (one of "screeplot", "scores" and "loadings")

ld

the principal components to be plotted: for scores, a pair of values e.g. c(1,2); for loadings either one or more values.

group

a vector of group memberships to order the individuals in "components" plot. If NULL, the clusters used for the DAPC will be used.

n_col

for loadings plots, if multiple LD axis are plotted, how many columns should be used.

...

not currently used.

Value

a ggplot2 object

Details

autoplot produces simple plots to quickly inspect an object. They are not customisable; we recommend that you use ggplot2 to produce publication ready plots.