Learn R Programming

dartR (version 1.9.9.1)

gl.dist.pop: Calculate a distance matrix for populations defined in an {adegenet} genlight object

Description

This script calculates various distances between populations based on allele frequencies. The distances are calculated by scripts in the stats or vegan libraries, with the exception of the pcfixed (percent fixed differences) distance.

Usage

gl.dist.pop(
  x,
  method = "euclidean",
  plot = TRUE,
  boxplot = "standard",
  range = 1.5,
  binary = FALSE,
  p = NULL,
  verbose = NULL
)

Arguments

x

-- name of the genlight containing the SNP genotypes [required]

method

-- Specify distance measure [euclidean]

plot

-- if TRUE, display a histogram of the genetic distances, and a whisker plot [TRUE]

boxplot

-- if 'standard', plots a standard box and whisker plot; if 'adjusted', plots a boxplot adjusted for skewed distributions ['standard']

range

-- specifies the range for delimiting outliers [1.5 interquartile ranges]

binary

-- Perform presence/absence standardization before analysis using decostand [FALSE]

p

-- The power of the Minkowski distance (typically a value ranging from 0.25 to infinity) [0.5]

verbose

-- verbosity: 0, silent or fatal errors; 1, begin and end; 2, progress log ; 3, progress and results summary; 5, full report [default 2 or as specified using gl.set.verbosity]

Value

An object of class 'dist' giving distances between populations

Details

The distance measure can be one of "manhattan", "euclidean", "pcfixed", "pa", canberra", "bray", "kulczynski", "jaccard", "gower", "morisita", "horn", "mountford", "raup" , "binomial", "chao", "cao", "mahalanobis", "maximum", "binary" or "minkowski". Refer to the documentation for dist stats or vegdist vegan for definitions.

Distance pcfixed calculates the pair-wise count of fixed allelic differences between populations.

Examples

Run this code
# NOT RUN {
gl.dist.pop(testset.gl, method="euclidean")
# }

Run the code above in your browser using DataLab