diverrare: Rarefaction curves using Jost diversities

Description Usage Arguments Details Value Examples

Description

Create rarefaction curves using Jost diversities.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
getSubsamplesForDiverRare(cm, sample.size, replicates = 10,
  levels = rep(c("gamma", "alpha", "beta"), 3), qs = rep(0:2, each = 3),
  is.transposed = FALSE, progressBar = TRUE, verbose = TRUE)

getDiverRare(cm, sample.sizes = 10, replicates = 10,
  levels = rep(c("gamma", "alpha", "beta"), 3), qs = rep(0:2, each = 3),
  progressBar = TRUE, min.sample.abundance = NA,
  non.rarefied.subsamples = TRUE, verbose = TRUE)

getMultiDiverRare(cm.list, min.sample.abundance.list = NA, ...)

ggDiverRare(diver.rare, multi.cm = FALSE, diversity = c(),
  line.or.point = 3, point.size = 2, title = "", x.lab = "sample size",
  y.lab = "diversity", ...)

Arguments

cm

The community matrix.

sample.size

An interger number representing subsample size for rarefying community using rrarefy. It must be smaller than the minimun sample abundance, which can be calculated by summaryCM.Vector.

replicates

The number of replicates to repeat subsampling.

levels

The levels of Jost diversities in d. Use paste(levels, qs, sep="") to get the actual measurements.

qs

The order of Jost diversities in d.

is.transposed

If TRUE, then cm is already the transposed matrix of vegdist input. Default to FASLE.

progressBar

Whether to print progress bar, default to TRUE.

sample.sizes

The vector of subsample sizes for rarefying community using rrarefy. It can be also an integer to define the length of vector, as default to 10, which allows to automatically create the vector of subsample sizes ranged by min.sample.abundance and max.sample.abundance of cm

min.sample.abundance

If min.sample.abundance of cm is smaller than this threshold, then return NULL.

non.rarefied.subsamples

If TRUE, as default, the subsamples will include non rarefied ones, whose sample.size > min.sample.abundance. rrarefy will also create warnings.

cm.list

The list of community matrices.

min.sample.abundance.list

The list of min.sample.abundance for each cm, the default is NA.

diver.rare

The rarefaction curves of one or more community matrices. Use multi.cm to determine.

multi.cm

If FALSE, as default, the diver.rare is calculated from one community matrix and no colour, otherwise it will be treated as a list of rarefaction curves from a list of community matrices and coloured by cm.

diversity

The vector of diversity included in the graph, such as c("gamma0","alpha0","beta1"). The default is empty vector to inlcude all diversities in diver.rare.

Details

getSubsamplesForDiverRare calculates subsamples for the rarefaction using Jost diversities, given a community matrix.

getDiverRare returns a list of subsamples calculated from getSubsamplesForDiverRare given a community matrix. Note: this community matrix must not be transposed.

getMultiDiverRare returns a list of rarefaction curves calculated from getDiverRare given a list of community matrices. Note: every community matrices must not be transposed.

ggDiverRare plots the rarefaction curves calculated from getDiverRare given a community matrix, or from getMultiDiverRare given a list of community matrices, and returns a ggplot object.

Value

getSubsamplesForDiverRare returns a list of results: mean is a named vector of means of each diversity measurement, sterr is the standard error of the mean, subsamples is a matrix of all subsampled points to calculate means and errors, where the columns are diversity measurements, rows are replicates.

Examples

1
2
3
4
5
6
7
8
diver.rare <- getSubsamplesForDiverRare(cm, 2000, 5)

diver.rare <- getDiverRare(cm, replicates=5)

multi.diver.rare <- getMultiDiverRare(cm.list, replicates=5)

gg.plot <- ggDiverRare(diver.rare)
gg.plot <- ggDiverRare(multi.diver.rare, multi.cm=T, x.trans="log", auto.scale.x=T)

walterxie/ComMA documentation built on May 3, 2019, 11:51 p.m.