gl.collapse | R Documentation |
This script takes a file generated by gl.fixed.diff and amalgamates populations with distance less than or equal to a specified threshold. The distance matrix is generated by gl.fixed.diff().
The script then applies the new population assignments to the genlight object and recalculates the distance and associated matrices.
gl.collapse(fd, tpop = 0, tloc = 0, pb = FALSE, verbose = NULL)
fd |
Name of the list of matrices produced by gl.fixed.diff() [required]. |
tpop |
Threshold number of fixed differences above which populations will not be amalgamated [default 0]. |
tloc |
Threshold defining a fixed difference (e.g. 0.05 implies 95:5 vs 5:95 is fixed) [default 0]. |
pb |
If TRUE, show a progress bar on time consuming loops [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] |
A list containing the gl object x and the following square matrices:
$gl – the new genlight object with populations collapsed;
$fd – raw fixed differences;
$pcfd – percent fixed differences;
$nobs – mean no. of individuals used in each comparison;
$nloc – total number of loci used in each comparison;
$expfpos – NA's, populated by gl.fixed.diff [by simulation]
$expfpos – NA's, populated by gl.fixed.diff [by simulation]
$prob – NA's, populated by gl.fixed.diff [by simulation]
Custodian: Arthur Georges – Post to https://groups.google.com/d/forum/dartr
fd <- gl.fixed.diff(testset.gl,tloc=0.05)
fd
fd2 <- gl.collapse(fd,tpop=1)
fd2
fd3 <- gl.collapse(fd2,tpop=1)
fd3
fd <- gl.fixed.diff(testset.gl,tloc=0.05)
fd2 <- gl.collapse(fd)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.