hap.div | R Documentation |
This function computes haplotype diversity from DNA sequences. This is a generic function.
hap.div(x, ...)
## S3 method for class 'haplotype'
hap.div(x, variance = FALSE, method = "Nei", ...)
## S3 method for class 'DNAbin'
hap.div(x, variance = FALSE, method = "Nei", ...)
x |
an object with DNA data. |
variance |
a logical value specifying whether to calculate the variance of the estimated haplotype diversity. |
method |
(unused, see details). |
... |
further arguments passed to and from methods. |
Currently, only Nei and Tajima's (1981) method is available.
a numeric vector with one or two values (if variance = TRUE
).
Emmanuel Paradis
Nei, M. and Tajima, F. (1981) DNA polymorphism detectable by restriction endonuclease. Genetics, 97, 145–163.
nuc.div
data(woodmouse)
hap.div(woodmouse) # all haplotypes are unique
## neuraminidase sequences from the 2009 H1N1 data (delivered with adegenet):
fl <- system.file("files/pdH1N1-NA.fasta", package = "adegenet")
H1N1.NA <- read.dna(fl, "fasta")
hap.div(H1N1.NA, TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.