Learn R Programming

dartR (version 1.1.11)

gl.gene.freq: Calculate a statistic for each locus by group An internal function essentially to convey readability to rather contorted R code. It takes as input a genlight {adegenet} object with an index variable (say, population) and calculates the selected statistic for each locus, broken down by the groups defined by the index variable.

Description

Calculate a statistic for each locus by group

An internal function essentially to convey readability to rather contorted R code. It takes as input a genlight {adegenet} object with an index variable (say, population) and calculates the selected statistic for each locus, broken down by the groups defined by the index variable.

Usage

gl.gene.freq(gl, method = pop(gl), stat = "mean")

Arguments

gl

-- name of the genlight object containing the SNP data [required]

method

-- breakdown variable [default pop(x)]

stat

-- statistic to calculate: mean [only mean(x)/2 currently implemented]

Value

A matrix, populations (rows) by loci (columns), showing the statistic [mean/2]

Examples

Run this code
# NOT RUN {
#result <- dartR:::gl.gene.freq(testset.gl, method=pop(gl), stat="mean")
# }

Run the code above in your browser using DataLab