island (version 0.2.4)

data_generation: Data simulation of colonization-extinction dynamics

Description

data_generation simulates species richness data according to the stochastic model of island biogeography PA_simulation simulates presence-absence data according to the stochastic model of island biogeography

Usage

data_generation(x, column, transitions, iter, times)

PA_simulation(x, column, transitions, times = 1)

Arguments

x

A dataframe with the vector of initial absences and presences.

column

A number indicating the column with the initial presence-absence data.

transitions

A matrix with the transition probabilities of the simulation, in the form (T01, T10), that can contain one single pair or multiple pairs.

iter

Number of times that the specified dynamics should be repeated.

times

Number of temporal steps to simulate.

Value

A matrix with species richness representing each row consecutive samples and each column a replica of the specified dynamics or a matrix with presence-absence data for the specified dynamics, each row representing a species and each column consecutive samplings.

Details

To simulate community assembly, we need an initial vector of presence-absence, from which the subsequent assembly process will be simulated. This initial vector is considered as x[, column].

See Also

cetotrans to obtain the transition probabilities associated with a colonization-extinction pair.

Examples

Run this code
# NOT RUN {
data_generation(as.data.frame(rep(0, 100)), 1,
matrix(c(0.5, 0.5), ncol = 2), 5, 25)
data_generation(alonso15[[1]], 3, matrix(c(0.5, 0.5), ncol = 2), 5, 25)
PA_simulation(as.data.frame(c(rep(0, 163), rep(1, 57))), 1, c(0.13, 0.19),
20)

# }

Run the code above in your browser using DataCamp Workspace