utilities {pegas}R Documentation

Utily Functions for pegas

Description

The first three functions extract information on loci. expand.genotype creates a table of all possible genotypes given a set of alleles.

Usage

getPloidy(x)
getAlleles(x)
getGenotypes(x)
expand.genotype(n, alleles = NULL, ploidy = 2, matrix = FALSE)

Arguments

x an object of class "loci".
n an integer giving how many alleles to consider (ignored if alleles is used.
alleles a vector of alleles as a character vector.
ploidy an integer giving the ploidy level (either 2 or 4 for the moment).
matrix a logical specifying whether to return the genotypes in a matrix or as a character vector.

Value

getPloidy returns the ploidy level of all loci in an object of class "loci" as a numeric vector.
getAlleles and getGenotpes return the alleles and genotypes, respectively, observed in all loci in an object of class "loci" as a list.
expand.genotype returns a character vector (the default) or a matrix where the rows are the genotypes and the columns are the alleles. The matrix is numeric by default, or character if the argument alleles is given.

Author(s)

Emmanuel Paradis

Examples

expand.genotype(2)
expand.genotype(2, LETTERS[1:3])
expand.genotype(3, ploidy = 4)

[Package pegas version 0.1 Index]