site.spectrum computes the (un)folded site frequency spectrum
of a set of aligned DNA sequences.site.spectrum(x, folded = TRUE, outgroup = 1)
## S3 method for class 'spectrum':
plot(x, col = "red", main = NULL, ...)"DNAbin"), or an object of class "spectrum".folded = FALSE.folded = TRUE.main = "" to have no title).barplot.site.spectrum returns an object of class "spectrum"
which is a vector of integers (some values may be equal to zero) with
the attribute "folded" (a logical value) indicating which
version of the spectrum has been computed. If folded = TRUE, sites with more than two states are ignored
and a warning is returned giving how many were found.
If folded = FALSE, sites with an ambiguous state at the
external sequence are ignored and a warning is returned giving how
many were found. Note that it is not checked if some sites have more
than two states.
DNAbin for manipulation of DNA sequences in R,
haplotyperequire(ape)
data(woodmouse)
(sp <- site.spectrum(woodmouse))
plot(sp)Run the code above in your browser using DataLab