Learn R Programming

dartR (version 1.1.11)

gl.subsample.loci: Subsample n loci from a genlight object and return as a genlight object

Description

This is a support script, to subsample a genlight {adegenet} object based on loci. Two methods are used to subsample, random and based on information content (avgPIC)

Usage

gl.subsample.loci(gl, n, method = "random")

Arguments

gl

-- name of the genlight object containing the SNP genotypes by specimen and population [required]

n

-- number of loci to include in the subsample [required]

method

-- "random", in which case the loci are sampled at random; or avgPIC, in which case the top n loci ranked on information content (AvgPIC) are chosen [default "random"]

Value

A genlight object with n loci

Examples

Run this code
# NOT RUN {
result <- gl.subsample.loci(testset.gl, n=200, method="avgPIC")
# }

Run the code above in your browser using DataLab