utilities {pegas} | R Documentation |
The first three functions extract information on loci.
expand.genotype
creates a table of all possible genotypes given
a set of alleles.
getPloidy(x) getAlleles(x) getGenotypes(x) expand.genotype(n, alleles = NULL, ploidy = 2, matrix = FALSE)
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. |
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.
Emmanuel Paradis
expand.genotype(2) expand.genotype(2, LETTERS[1:3]) expand.genotype(3, ploidy = 4)