as.mixstock.data: class for marker data from sources and mixed stocks

Description Usage Arguments Value Note Author(s) Examples

View source: R/mixstock.R

Description

This class provides a standard structure for information on markers (e.g. mitochondrial DNA samples) from a variety of different sources (e.g. sources) and from (a) mixed population(s) that draw(s) from those sources.

Usage

1
2
3
4
5
6
7
as.mixstock.data(object,nmix=1,sourcesize)
## S3 method for class 'mixstock.data'
plot(x,prop = TRUE, legend = TRUE, colors = rainbow(x$H), 
    leg.space = 0.3, leg.ncol, leg.cex=1, mix.off = 0.5,
    stacklabels=FALSE, sampsize=FALSE, horiz=TRUE, vlab="Haplotype frequency", ...)
## S3 method for class 'mixstock.data'
print(x,...)

Arguments

object

a matrix with (R+1) columns and (H) rows, where the columns specify R sources plus a mixed population, and the rows specify distinct marker classes (e.g. mitochondrial haplotypes)

x

a mixstock.data object

prop

reduce data to frequencies?

legend

add a legend to the plot?

colors

colors denoting different markers

horiz

logical: plot bars horizontally?

leg.space

space to leave for legend (fraction at top of graph)

leg.ncol

number of columns for legend (default is 3 for horizontal barplots, 1 for vertical)

leg.cex

character size for legend

mix.off

spacing offset for bar(s) representing mixed stock(s)

stacklabels

(logical) put source names on multiple lines?

sampsize

(logical) add text showing sample sizes?

nmix

number of mixed stocks (default 1)

sourcesize

either a numeric vector of relative source sizes, or "first" or "last" to specify that the first or last row of the matrix contains the source sizes

vlab

label for value axis

...

additional arguments to barplot

Value

mixstock.data objects have the following components:

R

number of sources

H

number of marker classes (haplotypes)

sourcesamp

samples from sources, in an HxR matrix

mixsamp

a vector of sample from the mixed population

print.mixstock.data and plot.mixstock.data give textual and graphical summaries of the results

Note

While vertical barplots are more familiar, horizontal barplots are useful for displaying long source/mixed stock names

Author(s)

Ben Bolker

Examples

1
2
3
4
x <- matrix(c(23,34,10,10,11,4,4,5,2),byrow=TRUE,nrow=3)
dx <- as.mixstock.data(x)
dx
plot(dx)

mixstock documentation built on May 2, 2019, 6:48 p.m.