Learn R Programming

primer (version 1.2.0)

MetaSim: Simulation of Stochastic Metapopulation Models

Description

Originally focused on creating a community of core-satellite species, this function allows simulation of several metapopulation models, where colonization and extinction rates are stochastic draws from uniform distributions, with specified means and ranges.

Usage

MetaSim(
  Time = 50,
  NSims = 1,
  method = "hanski",
  ci = 0.25,
  e = 0.25,
  phi = 0.75,
  p0 = 0.5,
  D = 0.5
)

Arguments

Time

A scalar for the number of time steps over which to simulate each population.

NSims

A scalar for the number of simulations, which is analogous to the number of species in the community.

method

A character string, in quotes, specifying which metapopulation model to use: "hanksi", "gotelli", "lande", "levins". See "See Also" below.

ci

Scalar for mean colonization rate.

e

Scalar for mean extinction rate.

phi

A scalar for the relative variability in rates. See Details.

p0

Initial proportion of sites occupied for each species.

D

Parameter for habitat destruction; applies to only the "lande" model.

Value

Function returns a list with these components.

method

The method used (default is "hanski").

time

The integer sequence of times, from 0 to the value of the argument Time.

Ns

Time by NSims matrix of observed population sizes.

Parameters

A named vector of the parameters used for the simulations.

Details

phi is one half of the relative range of each rate (colonization and extinction). For each time step, each rate is drawn from a uniform distribution, Unif(rate-phi, rate+phi). Thus, the range is 2*phi, and center on the specified mean (ci or e).

References

Stevens. M.H.H. (2009) A Primer of Ecology with R. Use R! Series. Springer.

See Also

gotelli, hanski, levins

Examples

Run this code
# NOT RUN {
out <- MetaSim(NSims=2)
pops <- out$Ns
matplot(out$t, pops, type='l')
title(sub=paste(out$method, "model"))

# }

Run the code above in your browser using DataLab