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

tab

Access allele counts or frequencies


Description

This accessor is used to retrieve a matrix of allele data. By default, a matrix of integers representing allele counts is returned. If freq is TRUE, then data are standardised as frequencies, so that for any individual and any locus the data sum to 1. The argument NA.method allows to replace missing data (NAs). This accessor replaces the previous function truenames as well as the function makefreq.

Usage

tab(x, ...)

## S4 method for signature 'genind'
tab(x, freq = FALSE, NA.method = c("asis", "mean", "zero"), ...)

## S4 method for signature 'genpop'
tab(x, freq = FALSE, NA.method = c("asis", "mean", "zero"), ...)

Arguments

x

a genind or genpop object.

...

further arguments passed to other methods.

freq

a logical indicating if data should be transformed into relative frequencies (TRUE); defaults to FALSE.

NA.method

a method to replace NA; asis: leave NAs as is; mean: replace by the mean allele frequencies; zero: replace by zero

Value

a matrix of integers or numeric

Examples

data(microbov)
head(tab(microbov))
head(tab(microbov,freq=TRUE))

adegenet

Exploratory Analysis of Genetic and Genomic Data

v2.1.3
GPL (>= 2)
Authors
Thibaut Jombart [aut] (<https://orcid.org/0000-0003-2226-8692>), Zhian N. Kamvar [aut, cre] (<https://orcid.org/0000-0003-1458-7108>), Caitlin Collins [ctb], Roman Lustrik [ctb], Marie-Pauline Beugin [ctb], Brian J. Knaus [ctb], Peter Solymos [ctb], Vladimir Mikryukov [ctb], Klaus Schliep [ctb], Tiago Maié [ctb], Libor Morkovsky [ctb], Ismail Ahmed [ctb], Anne Cori [ctb], Federico Calboli [ctb], RJ Ewing [ctb], Frédéric Michaud [ctb], Rebecca DeCamp [ctb], Alexandre Courtiol [ctb] (<https://orcid.org/0000-0003-0637-2959>)
Initial release

We don't support your browser anymore

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