Learn R Programming

dartR (version 1.1.11)

gl.keep.pop: Remove all but specified populations from a genelight {adegenet} object

Description

Individuals are assigned to populations based on the specimen metadata data file (csv) used with gl.read.dart().

Usage

gl.keep.pop(x, pop.list, recalc = FALSE, mono.rm = TRUE, v = 2)

Arguments

x

-- name of the genlight object containing SNP genotypes or a genind object containing presence/absence data [required]

pop.list

-- a list of populations to be kept [required]

recalc

-- Recalculate the locus metadata statistics [default FALSE]

mono.rm

-- Remove monomorphic loci [default TRUE]

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 genlight object with the reduced data

Details

The script, having deleted the specified populations, optionally identifies resultant monomorphic loci or loci with all values missing and deletes them (using gl.filter.monomorphs.r). The script also optionally recalculates statistics made redundant by the deletion of individuals from the dataset.

The script returns a genlight object with the new population assignments and the recalculated locus metadata.

See Also

gl.filter.monomorphs

gl.recalc.metrics

Examples

Run this code
# NOT RUN {
   gl <- gl.keep.pop(testset.gl, pop.list=c("EmsubRopeMata","EmvicVictJasp"))
# }

Run the code above in your browser using DataLab