Description Usage Arguments Details Value Note Examples
View source: R/allele_divtables-class.R
S3 method to convert an object of class genalex
to an object of
class allele_divtables
. a list of divtable
objects representing sites-by-allele counts. This is an S3 generic
so that other methods might be written to convert other genetic
formats.
1 2 3 4 5 6 7 8 9 | ## Default S3 method:
createAlleleTables(x, ...)
## S3 method for class 'allele_divtables'
createAlleleTables(x, ...)
## S3 method for class 'genalex'
createAlleleTables(x, exclude = c(NA, "0"), quiet = TRUE,
...)
|
x |
Object of class |
exclude |
Values in |
quiet |
If |
If x
is not of class genalex
, an attempt is made to convert
it to class genalex
using as.genalex
from the
readGenalex
package. An error will be produced if x
is of a class or format
that cannot be converted to class genalex
.
Another option for converting genotypes to allele_divtables
objects is to convert to one of the formats recognised by
as.genalex
.
Although missing alleles may be common in genotypic data, there is no
provision in diversity
and other functions in this package
for missing data. Missing alleles are recognised and excluded if they
match one of the values in exclude
. The numbers of missing alleles
recognised is reported if quiet = FALSE
.
Object of class allele_divtable
as.allele_divtables
is a synonym, unless x
is of class
list
. If so, if the class of each element of x
is of class
divtable
, then the class of x
is changed to
allele_divtable
. If x
is of class
allele_divtables
it is returned unchanged.
1 2 3 4 5 6 7 8 9 10 11 | ## Use genotype data from readGenalex package, already loaded
data(Qagr_pericarp_genotypes)
pal <- createAlleleTables(Qagr_pericarp_genotypes)
str(pal)
## The divtable for the first locus
pal[[1]]
## allele_divtables removes and can report missing data
data(Qagr_adult_genotypes)
aal <- createAlleleTables(Qagr_adult_genotypes, quiet = FALSE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.