Learn R Programming

metricTester (version 1.3.6)

competitionArena: Simulate competitive exclusion over multiple generations

Description

Given a simulations.input object, creates an initial random arena, then removes some closely related individuals in the arena, settles individuals based on abundances from a regional species pool, and repeats across the desired number of generations.

Usage

competitionArena(simulations.input)

Arguments

simulations.input

A prepared simulations.input object from prepSimulations

Value

A list of 5 elements: the average relatedness in the geographic neighborhood of consideration (appended to any previous values that were fed into the function), the number of individuals killed, the original input regional abundance vector, the new spatial arena, and the dimensions of that arena. On the last iteration, it returns the arena BEFORE settling new individuals randomly.

Details

This function combines the killSome and settleSome functions into a loop that runs for the desired number of generations. If the number of individuals in the arena exceeds 50,000, then the killSomeBig function is invoked. This runs much slower than the default version of the function, but will not use all memory and crash at large numbers of individuals.

References

Miller, E. T., D. R. Farine, and C. H. Trisos. 2016. Phylogenetic community structure metrics and null models: a review with new methods and software. Ecography DOI: 10.1111/ecog.02070

Examples

Run this code
# NOT RUN {
tree <- geiger::sim.bdtree(b=0.1, d=0, stop="taxa", n=50)

prepped <- prepSimulations(tree, arena.length=300, mean.log.individuals=2, 
	length.parameter=5000, sd.parameter=50, max.distance=20, proportion.killed=0.2,
	competition.iterations=2)

test <- competitionArena(prepped)
# }

Run the code above in your browser using DataLab