plot.DNAmat_class: Site frequency spectrum plot

Description Usage Arguments Details Examples

View source: R/plot_DNAmat_class.R

Description

Plots the site frequency spectrum.

Usage

1
2
3
## S3 method for class 'DNAmat_class'
plot(DNAmat, xlab = "Index i",
  ylab = "Number of i-tons", main = "Site frequency spectrum", ...)

Arguments

DNAmat

matrix; either a single-nucleotide polymorphism matrix or a segregating sites matrix of class 'DNAmat_class'. See SNP for explanation.

xlab

a title for the x axis. Is by default "Index i". See title.

ylab

a title for the y axis. Is by default "Number of i-tons". See title.

main

an overall title for the plot. Is by default "Site frequency spectrum". See title.

...

arguments passed on from plot.

Details

The terminology "Number of i-tons" corresponds to the i'th entry in the site frequency spectrum. See SFS for further explanation.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# Using the function simDNAseq:
plot(simDNAseq(n = 8, seqLen = 20, mutRate = 5,
               popType = "varPop", expRate = 1.5), col="red")


# Creating a segregating sites matrix by hand:
SegSitesMat <- matrix(sample(x=c(0, 1), size=26*12,
                      replace=TRUE, prob=c(0.9, 0.1)),
                      nrow=12, ncol=26, byrow=TRUE)
class(SegSitesMat) <- "DNAmat_class"
plot(SegSitesMat)

aumath-advancedr2019/simDNA documentation built on Nov. 27, 2019, 11 a.m.