runNulls: Randomize input CDM according to defined null models

Description Usage Arguments Details Value References Examples

View source: R/runNulls.R

Description

Given a prepared nulls.input object, will randomize a community data matrix according to specified null models, and return a list of randomized CDMs.

Usage

1
runNulls(nulls.input, nulls, new_ = FALSE)

Arguments

nulls.input

Prepped nulls.input object

nulls

Optional. If not provided, defines the nulls as all of those in defineNulls. If only a subset of those is desired, then nulls should take the form of a character vector corresponding to named functions from defineNulls. The available nulls can be determined by running names(defineNulls()). Otherwise, if the user would like to define a new null on the fly, the argument nulls can take the form of a named list of new functions (nulls). If the latter, new_ must be set to TRUE.

new_

Whether or not new nulls are being defined on the fly. Default is FALSE. Set to TRUE if a new null is being used.

Details

Determine which nulls will be calculated by running names(defineNulls()). If only a subset of these is desired, supply metrics with a character vector of the named, available metrics.

Value

A list of matrices. Each matrix is a product of a randomization of the input CDM and one of the specified null models.

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
#simulate tree with birth-death process
tree <- geiger::sim.bdtree(b=0.1, d=0, stop="taxa", n=50)

sim.abundances <- round(rlnorm(5000, meanlog=2, sdlog=1)) + 1

cdm <- simulateComm(tree, richness.vector=10:25, abundances=sim.abundances)

prepped <- prepNulls(tree, cdm)

results <- runNulls(prepped)

metricTester documentation built on Dec. 16, 2019, 1:20 a.m.