settleSome: Randomly settle individuals in a spatial arena

Description Usage Arguments Details Value References Examples

View source: R/settleSome.R

Description

Given output from the killSome function, randomly settles individuals in the arena.

Usage

1
settleSome(killSome.output)

Arguments

killSome.output

Output from the killSome function

Details

This function uses the number killed element of the killSome output to randomly draw from the regional abundance vector, then settles the individuals at random in the arena.

Value

A list of 4 elements: the average relatedness in the geographic neighbordhood of consideration (passed directly from the killSome output, not re-calculated here), the regional abundance vector, the new spatial arena, and the dimensions of that arena.

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
#simulate tree with birth-death process
tree <- geiger::sim.bdtree(b=0.1, d=0, stop="taxa", n=50)

#prep the data for the simulation
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=5)

#use the competition simulation
positions <- competitionArena(prepped)

#in normal use, these parameters will be carried down from the simulations.input object
new.arena <- killSome(tree, arena.output=positions, max.distance=50, 
proportion.killed=0.2)

#now settle some indiviudals
newer.arena <- settleSome(new.arena)

#look at how number of individuals in arena changes
dim(new.arena$arena)
dim(newer.arena$arena)

eliotmiller/metricTester documentation built on Dec. 16, 2019, 12:39 p.m.