This function deletes individuals and their associated metadata. Monomorphic loci and loci that are scored all NA are optionally deleted (mono.rm=TRUE). The script also optionally recalculates locus metatdata statistics to accommodate the deletion of individuals from the dataset (recalc=TRUE).
The script returns a dartR genlight object with the retained individuals and the recalculated locus metadata. The script works with both genlight objects containing SNP genotypes and Tag P/A data (SilicoDArT).
gl.drop.ind(x, ind.list, recalc = FALSE, mono.rm = FALSE, verbose = NULL)Name of the genlight object [required].
List of individuals to be removed [required].
If TRUE, recalculate the locus metadata statistics [default FALSE].
If TRUE, remove monomorphic and all NA loci [default FALSE].
Verbosity: 0, silent or fatal errors; 1, begin and end; 2, progress but not results; 3, progress and results summary; 5, full report [default 2 or as specified using gl.set.verbosity].
A reduced dartR genlight object
gl.keep.ind to keep rather than drop specified
individuals
Other dartR-base:
gl.drop.loc(),
gl.drop.pop(),
gl.edit.recode.ind(),
gl.edit.recode.pop(),
gl.keep.loc(),
gl.make.recode.ind(),
gl.read.dart(),
gl.recode.ind(),
gl.recode.pop(),
gl.set.verbosity()
 # SNP data
   gl2 <- gl.drop.ind(testset.gl,
   ind.list=c('AA019073','AA004859'))
#> Starting gl.drop.ind 
#>   Processing genlight object with SNP data
#>   Deleting specified individuals
#>   Warning: Resultant dataset may contain monomorphic loci
#>   Locus metrics not recalculated
#> Completed: gl.drop.ind 
#> 
 # Tag P/A data
   gs2 <- gl.drop.ind(testset.gs,
   ind.list=c('AA020656','AA19077','AA004859'))
#> Starting gl.drop.ind 
#>   Processing genlight object with Presence/Absence (SilicoDArT) data
#>   Warning: Listed individual AA004859 not present in the dataset -- ignored
#>   Deleting specified individuals
#>   Warning: Resultant dataset may contain monomorphic loci
#>   Locus metrics not recalculated
#> Completed: gl.drop.ind 
#> 
   gs2 <- gl.drop.ind(testset.gs, ind.list=c('AA020656'
   ,'AA19077','AA004859'),mono.rm=TRUE, recalc=TRUE)
#> Starting gl.drop.ind 
#>   Processing genlight object with Presence/Absence (SilicoDArT) data
#>   Warning: Listed individual AA004859 not present in the dataset -- ignored
#>   Deleting specified individuals
#>   Deleting monomorphic loc
#>   Recalculating locus metrics
#> Completed: gl.drop.ind 
#>