gl.dist.ind | R Documentation |
This script calculates various distances between individuals based on allele frequencies or presence-absence data
gl.dist.ind(
x,
method = NULL,
scale = FALSE,
swap = FALSE,
output = "dist",
plot.out = TRUE,
plot_theme = theme_dartR(),
plot_colors = two_colors,
save2tmp = FALSE,
verbose = NULL
)
x |
Name of the genlight containing the SNP genotypes or presence-absence data [required]. |
method |
Specify distance measure [SNP: Euclidean; P/A: Simple]. |
scale |
If TRUE, the distances are scaled to fall in the range [0,1] [default TRUE] |
swap |
If TRUE and working with presence-absence data, then presence (no disrupting mutation) is scored as 0 and absence (presence of a disrupting mutation) is scored as 1 [default FALSE]. |
output |
Specify the format and class of the object to be returned, 'dist' for a object of class dist, 'matrix' for an object of class matrix [default "dist"]. |
plot.out |
If TRUE, display a histogram and a boxplot of the genetic distances [TRUE]. |
plot_theme |
User specified theme [default theme_dartR]. |
plot_colors |
Vector with two color names for the borders and fill [default two_colors]. |
save2tmp |
If TRUE, saves any ggplots to the session temporary directory [default FALSE]. |
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]. |
The distance measure for SNP genotypes can be one of:
Euclidean Distance [method = "Euclidean"]
Scaled Euclidean Distance [method='Euclidean", scale=TRUE]
Simple Mismatch Distance [method="Simple"]
Absolute Mismatch Distance [method="Absolute"]
Czekanowski (Manhattan) Distance [method="Manhattan"]
The distance measure for Sequence Tag Presence/Absence data (binary) can be one of:
Euclidean Distance [method = "Euclidean"]
Scaled Euclidean Distance [method='Euclidean", scale=TRUE]
Simple Matching Distance [method="Simple"]
Jaccard Distance [method="Jaccard"]
Bray-Curtis Distance [method="Bray-Curtis"]
Refer to the dartR Technical Note on Distances in Genetics.
An object of class 'matrix' or dist' giving distances between individuals
Author(s): Arthur Georges. Custodian: Arthur Georges – Post to #' https://groups.google.com/d/forum/dartr
D <- gl.dist.ind(testset.gl[1:20,], method='manhattan')
D <- gl.dist.ind(testset.gs[1:20,], method='Jaccard',swap=TRUE)
D <- gl.dist.ind(testset.gl[1:20,], method='euclidean',scale=TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.