Learn R Programming

dartR (version 1.1.11)

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) and pa (total private alleles) distances.

Usage

gl.dist.pop(x, method = "euclidean", binary = FALSE, diag = TRUE,
  upper = FALSE, p = NULL, v = 2)

Arguments

x

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

method

-- Specify distance measure [method=euclidean]

binary

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

diag

-- Compute and display diagonal [TRUE]

upper

-- Return also upper triangle [FALSE]

p

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

v

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

Value

A matrix of distances between populations (class dist)

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. Distance pa tallies the total number of private alleles possessed by one or the other population.

Examples

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

Run the code above in your browser using DataLab