View source: R/utils.dist.binary.r
utils.dist.binary | R Documentation |
This script calculates various distances between individuals based on sequence tag Presence/Absence data.
utils.dist.binary(
x,
method = "simple",
scale = FALSE,
swap = FALSE,
output = "dist",
verbose = NULL
)
x |
Name of the genlight containing the genotypes [required]. |
method |
Specify distance measure [default simple]. |
scale |
If TRUE and method='euclidean', the distance will be scaled to fall in the range [0,1] [default FALSE]. |
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"]. |
verbose |
Verbosity: 0, silent or fatal errors; 1, begin and end; 2, progress log; 3, progress and results summary; 5, full report [default 2]. |
The distance measure can be one of:
Euclidean – Euclidean Distance applied to cartesian coordinates defined by the loci, scored as 0 or 1. Presence and absence equally weighted.
simple – simple matching, both 1 or both 0 = 0; one 1 and the other 0 = 1. Presence and absence equally weighted.
Jaccard – ignores matching 0, both 1 = 0; one 1 and the other 0 = 1. Absences could be for different reasons.
Bray-Curtis – both 0 = 0; both 1 = 2; one 1 and the other 0 = 1. Absences could be for different reasons. Sometimes called the Dice or Sorensen distance.
One might choose to disregard or downweight absences in comparison with presences because the homology of absences is less clear (mutation at one or the other, or both restriction sites). Your call.
An object of class 'dist' or 'matrix' giving distances between individuals
Author: Arthur Georges. Custodian: Arthur Georges – Post to https://groups.google.com/d/forum/dartr
D <- utils.dist.binary(testset.gs, method='Jaccard')
D <- utils.dist.binary(testset.gs, method='Euclidean',scale=TRUE)
D <- utils.dist.binary(testset.gs, method='Simple')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.