tsDiagnostic: Diagnostics for Community Simulation

View source: R/tsDiagnostic.R

tsDiagnosticR Documentation

Diagnostics for Community Simulation

Description

Diagnostics for the outcome of a community simulation. Reports the number of species that went extinct at the end of the simulation and the number and proportion of zeros in the time series. In addition, it offers diagnostic plots.

Usage

tsDiagnostic(x, mode = "ind", plot = TRUE, spec.index = 1,
  spec.meta = NA, threshold = 0.01, K = NA, ...)

Arguments

x

community time series, rows are species and columns are time points

mode

plot time vs number of species (spec), number of individuals/sum of abundance (ind) or the distribution of the species with given index (distrib)

plot

plot the diagnostic plot of selected mode

spec.index

row index of selected species (optional, required for mode distrib)

spec.meta

proportion of selected species in the meta-community (optional, if provided it is added in plot mode distrib)

threshold

threshold below which species are considered dead

K

carrying capacity, in case of Hubbell and SOI, the number of individuals (optional, if provided it is shown in plot mode ind)

\dots

Additional arguments passed to plot()

Value

depending on the mode, the function returns the number of surviving species over time, the number of individuals over time or the species distribution at the given time point

Examples

## Not run: 
N=50
m.vector=generateAbundances(N,mode=5,probabs=TRUE)
outH=simHubbell(M=N,N=N,I=1000,m.vector=m.vector,tend=1000)
diagnostics=tsDiagnostic(outH,mode="distrib",spec.index = 4,spec.meta = m.vector[4])
diagnostics=tsDiagnostic(outH,mode="spec")
diagnostics=tsDiagnostic(outH,mode="ind")

## End(Not run)

hallucigenia-sparsa/seqtime documentation built on Jan. 9, 2023, 11:53 p.m.