growthFunction: Simulate community

Description Usage Arguments Value Examples

View source: R/simulateCommunity.R

Description

Simulate the dynamics of the abundance of the species in the community with parameters reflecting the interaction intensity among members of the community.

Usage

1
growthFunction(N, alpha, c0, ck, init)

Arguments

N

Number of members in the community.

alpha

1xN vector of intrinsic growth rate of each member of the community.

c0

NxN matrix of pairwise interaction intensity in the community. c0[i,j] is the impact of j on i per j unit.

ck

A list of N matrix, each with NxN entries. ck[[k]][i,j] is the higher order impact from species j onto the pairwise interaction of i and k, felt by k.

init

1xN vector of initial abundance of each member in the community.

Value

A DataFrame, with row being each time point and columns species. The abundance vs. time plot is also rendered.

Examples

1
2
3
4
# Simulate parameters for a 4 species community
param <- simulateParam(4)
abundance <- growthFunction(param$N, param$alpha, param$c0, param$ck, 
param$init)

yuan-yin-truly/CommunitySim documentation built on Jan. 21, 2022, 9:11 p.m.