Learn R Programming

metricTester (version 1.3.6)

randomArena: Generate a random spatial arena

Description

Given a simulations.input object, will create a randomly settled arena according to the parameters in the simulations.input object.

Usage

randomArena(simulations.input)

Arguments

simulations.input

A prepared simulations.input object from prepSimulations

Value

A list of 4 elements: the mean of the genetic distance matrix of the input phylogeny, the regional abundance vector (where each element is a species name, repeated as many times as is present in pool), the spatial arena, and the dimensions of that arena.

Details

This function uses the log-normal regional abundance distribution to randomly assign abundances to species in the tree. It then draws from this regional abundance distribution to settle individuals at random in the landscape.

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 <- randomArena(prepped)
# }

Run the code above in your browser using DataLab