Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

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]

Author(s)

Arthur Georges (Post to https://groups.google.com/d/forum/dartr)

Examples

#result <- gl.gene.freq(testset.gl, method=pop(gl), stat="mean")

dartR

Importing and Analysing SNP and Silicodart Data Generated by Genome-Wide Restriction Fragment Analysis

v1.9.6
GPL-2
Authors
Bernd Gruber [aut, cre], Arthur Georges [aut], Jose L. Mijangos [aut], Peter J. Unmack [ctb], Oliver Berry [ctb], Lindsay V. Clark [ctb], Floriaan Devloo-Delva [ctb]
Initial release
2021-04-29

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.