Genetic data matrices are often arranged with one allele
in each column of the matrix (particularly for micro-satellites), so
that the number of columns is equal to the number of loci times the
level of ploidy. alleles2loci
transforms such matrices into a
"loci"
object.
If the rownames of the input matrix are already set, they are used in
the output. Alternatively, it is possible to specify which column to
use as rownames (this column will be deleted before creating the
genotypes).
If the input matrix has colnames, then the names of the first column of
each genotype is used as names of the output loci (see examples).
loci2alleles
checks that all individuals have the ploidy for a
given locus (if not an error occurs), but ploidy can vary among loci.