Skip to contents

Estimate the maximum number of groups in DAPC analysis

Usage

find_max_nclust(
  x,
  threshold,
  max.nclust,
  nperm = 100,
  method = "kmeans",
  stat = "BIC",
  criterion = "diffNgroup",
  subset = 100,
  confidence.level = c(0.7, 0.8, 0.9, 0.95, 0.99)
)

Arguments

x

A data.frame or matrix object containing eigenvectors by sites.

threshold

Scalar. The number of eigenvectors used to perform classification.

max.nclust

Scalar indicating the maximum number of groups to be evaluated.

nperm

Scalar. Number of times classification will be performed.

method

c("kmeans","ward"). See find.clusters of adegenet package.

stat

c("BIC", "AIC", or "WSS"). See find.clusters of adegenet package.

criterion

c("diffNgroup", "min","goesup", "smoothNgoesup", or "goodfit"). See find.clusters of adegenet package.

subset

number of cells used in the analysis. It is particularly important whenever the total number of cells is large (> 1000).

confidence.level

threshold confidence level used to estimate congruence in the classification pattern.

Value

Matrix containing congruence values ranging between 0-1 for each max.nclust value (see Arguments) and confidence level.

Examples

if (FALSE) {
data(regions)
evovectors <- regions$PCPS$vectors # eigenvectors by site
find_max_nclust(x=evovectors, threshold=3,max.nclust=10)
}