as.mixstock.data {mixstock} | R Documentation

## class for marker data from sources and mixed stocks

### 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

    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, ...)
    ## 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
`...` | 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

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

[Package mixstock version 0.9.2 Index]