errorChecker: Wrapper for summarizing randomizations and testing...

Description Usage Arguments Details Value References Examples

View source: R/errorChecker.R

Description

Given a data frame of observed metrics and a list of randomizations based on different null models, returns a list of data frames summarizing the significance of observed metrics both at the single plot and the entire arena level.

Usage

1
errorChecker(observed, reduced.randomizations, concat.by)

Arguments

observed

Data frame of observed metric scores, such as from observedMetrics()

reduced.randomizations

List of random, reduced results, such as those from reduceRandomizations()

concat.by

Whether to concatenate the randomizations by richness, plot or both

Details

This function wraps a number of smaller functions into a useful type I and II error checker. It takes a reduced list of randomizations such as those reduced from metricsNnulls with reduceRandomizations, summarizes the mean, SD, and CI of each metric plus null model either at the richness or plot level, then compares the observed metric scores to those summarized metrics. It return a list with two elements. The first is a list of data frames, where each corresponds to the standardized effect scores of the observed metrics for a given null model. The second is a list of data frames, where each corresponds to whether a given plot deviates beyond CI. For the latter, 0 corresponds to within CI, 1 corresponds to less than the CI, and 2 corresponds to greater than the CI.

Value

A list of lists of data frames.

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

#simulate a log normal abundance distribution
sim.abundances <- round(rlnorm(5000, meanlog=2, sdlog=1)) + 1

#simulate a community of varying richness
cdm <- simulateComm(tree, richness.vector=10:13, abundances=sim.abundances)

#run the metrics and nulls combo function
rawResults <- metricsNnulls(tree=tree, picante.cdm=cdm, randomizations=2, cores="seq",
nulls=c("richness","frequency"), metrics=c("richness","NAW_MPD"))

#summarize the results
results <- reduceRandomizations(rawResults)

#calculate the observed metrics from the input CDM
observed <- observedMetrics(tree, cdm, metrics=c("richness", "NAW_MPD"))

test <- errorChecker(observed, results, "richness")

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