simulateHubbell {miaSim}R Documentation

Hubbell's neutral model simulation

Description

Neutral species abundances simulation according to the Hubbell model.

Usage

simulateHubbell(
  n.species,
  M,
  I = 1000,
  d = 10,
  m = 0.02,
  tskip = 0,
  tend,
  norm = FALSE
)

Arguments

n.species

Integer: the amount of different species initially in the local community

M

Integer: amount of different species in the metacommunity, including those of the local community

I

Integer: fixed amount of individuals in the local community (default: I = 1000)

d

Integer: fixed amount of deaths of local community individuals in each generation (default: d = 10)

m

Numeric: immigration rate: the probability that a death in the local community is replaced by a migrant of the metacommunity rather than by the birth of a local community member (default: m = 0.02)

tskip

Integer: number of generations that should not be included in the outputted species abundance matrix. (default: tskip = 0)

tend

Integer: number of simulations to be simulated

norm

Logical: whether the time series should be returned with the abundances as proportions (norm = TRUE) or the raw counts (default: norm = FALSE)

Value

simulateHubbell returns a SummarizedExperiment class object containing matrix with species abundance as rows and time points as columns

References

Rosindell, James et al. "The unified neutral theory of biodiversity and biogeography at age ten." Trends in ecology & evolution vol. 26,7 (2011).

Examples

colData <- DataFrame(sampleID = c(seq_len(100)),
                        time = as.Date(100, origin = "2000-01-01"))

rowData <- data.frame(Kingdom = "Animalia",
                Phylum = rep(c("Platyhelminthes", "Mollusca"), c(50, 50)),
                Class = rep(c("Turbellaria", "Polyplacophora"), each = 50),
                ASV1 = paste0("D", seq_len(100)),
                ASV2 = paste0("E", seq_len(100)),
                ASV3 = paste0("F", seq_len(100)),
                ASV4 = paste0("G", seq_len(100)),
                ASV5 = paste0("H", seq_len(100)),
                ASV6 = paste0("J", seq_len(100)),
                ASV7 = paste0("K", seq_len(100)),
                row.names = rownames(paste0("species", seq_len(10))),
                stringsAsFactors = FALSE)

rowData <- t(rowData)

ExampleHubbell <- simulateHubbell(n.species = 8, M = 10, I = 1000, d = 50,
                                                        m = 0.02, tend = 100)
rowData(ExampleHubbell) <- rowData
colData(ExampleHubbell) <- colData


[Package miaSim version 0.99.1 Index]