Learn R Programming

metricTester (version 1.3.6)

summaries: Return summary statistics from a data frame of randomized metric values

Description

Summarizes observed metric scores. Returns the mean, standard deviation and 95% confidence intervals of each plot or observed richness.

Usage

summaries(null.output, concat.by = "richness")

Arguments

null.output

Data frame of randomized metric values such as an element from a call to reduceRandomizations()

concat.by

Whether to concatenate the randomizations by richness, plot or both

Value

Either a list of or a data frame of summarized metric scores, see details.

Details

Given a data frame of metric values, summarizes either by plot or richness. Outputs the mean, standard deviation and 95% confidence intervals of each plot or observed richness. If provided with concat.by="both", outputs a list of two data frames, one for by richness and one for by plot. Otherwise, outputs a data frame. Importantly, note that this function assumes that the first metric is species richness. This applies even if the user does not wish to summarize by "richness" or by "both". This is a design flaw and will be rectified in future versions of the package. For now, see the examples for the correct way to specify that the first metric is indeed "richness".

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 {
#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)

#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)

test <- summaries(results$frequency, concat.by="richness")
# }

Run the code above in your browser using DataLab