Learn R Programming

metricTester (version 1.2.2)

linker: Run spatial simulations, null and metric calculations to test metric + null performance

Description

This function wraps a number of wrapper functions into one big metric + null tester function. Only a single test is performed, with results saved into memory.

Usage

linker(no.taxa, arena.length, mean.log.individuals, length.parameter, sd.parameter, max.distance, proportion.killed, competition.iterations, no.plots, plot.length, concat.by, randomizations, cores, simulations, nulls, metrics)

Arguments

no.taxa
The desired number of species in the input phylogeny
arena.length
A numeric, specifying the length of a single side of the arena
mean.log.individuals
Mean log of abundance vector from which species abundances will be drawn
length.parameter
Length of vector from which species' locations are drawn. Large values of this parameter dramatically decrease the speed of the function but result in nicer looking communities
sd.parameter
Standard deviation of vector from which species' locations are drawn
max.distance
The geographic distance within which neighboring indivduals should be considered to influence the individual in question
proportion.killed
The percent of individuals in the total arena that should be considered (as a proportion, e.g. 0.5 = half)
competition.iterations
Number of generations over which to run competition simulations
no.plots
Number of plots to place
plot.length
Length of one side of desired plot
concat.by
Whether to concatenate the randomizations by richness, plot or both
randomizations
The number of randomized CDMs, per null, to generate. These are used to compare the significance of the observed metric scores.
cores
The number of cores to be used for parallel processing.
simulations
Optional list of named spatial simulation functions to use. These must be defined in the defineSimulations function. If invoked, this option will likely be used to run a subset of the defined spatial simulations.
nulls
Optional list of named null model functions to use. If invoked, this option will likely be used to run a subset of the defined null models.
metrics
Optional list of named metric functions to use. If invoked, this option will likely be used to run a subset of the defined metrics.

Value

A list of lists of data frames. The first level of the output has one element for each simulation. The second level has one element for each null model. Each of these elements is a list of two data frames, one that summarizes the plot-level significance and another and arena-level significance.

Details

This function wraps a number of other wrapper functions into one big metric + null performance tester function. Only a single test is performed, with results saved into memory. To perform multiple complete tests, use the multiLinker function, which saves results to file.

References

Miller, E. T., D. R. Farine, and C. H. Trisos. 2015. Phylogenetic community structure metrics and null models: a review with new methods and software. bioRxiv 025726.

Examples

Run this code
#below not run for timing issues on CRAN
#system.time(test <- linker(no.taxa=50, arena.length=300, mean.log.individuals=2, 
	#length.parameter=5000, sd.parameter=50, max.distance=30, proportion.killed=0.2, 
#competition.iterations=3, no.plots=15, plot.length=30, concat.by="richness", 
#randomizations=3, cores="seq",
#nulls=list("richness"=metricTester:::my_richnessNull,
#"frequency"=metricTester:::my_frequency)))

Run the code above in your browser using DataLab