Learn R Programming

metricTester (version 1.3.6)

sesTraitField: Calculate a species' standardized trait field

Description

Calculate the null-model standardized effect size of a species' trait field.

Usage

sesTraitField(trait.distance, tree, picante.cdm, metric, null,
  randomizations, distances.among = NULL, abundance.matters = TRUE,
  abundance.assigned = "directly", cores = "seq")

Arguments

trait.distance

Symmetrical matrix summarizing pairwise trait distances.

tree

Phylo object.

picante.cdm

A picante-style community data matrix with sites as rows, and species as columns.

metric

Phylogenetic metric of choice (see details).

null

Null model of choice (see details).

randomizations

The number of times the input CDM should be randomized and the metrics calculated across it.

distances.among

A symmetric distance matrix, summarizing the distances among all plots from the cdm. For use with the dispersal null.

abundance.matters

Default is TRUE. If FALSE, species are sampled from neighboring grid cells with equal probability. For use with the dispersal null.

abundance.assigned

For use with the dispersal null. See details there.

cores

This function can run in parallel. In order to do so, the user must specify the desired number of cores to utilize. The default is "seq", which runs the calculations sequentially.

Value

Data frame of standardized effect sizes of species' trait fields. Table includes the observed trait field, the mean and standard deviation of the species' trait field after randomization with the chosen null model, and the resulting species-specific standardized effect size.

Details

This function is being deprecated. This and the rest of the first generation of field functions are being replaced by a two-step process akin to the calcMetrics set of functions. The user first preps the data with a prep function, then runs the desired metrics and nulls over the prepped object. This allows sets of metrics to be calculated over the same randomized matrix, rather than having to repeatedly generate the same random matrix for each metric. The trait distance matrix should be symmetrical and "complete". See example. Currently only non-abundance-weighted mean pairwise and interspecific abundance-weighted mean pairwise phylogenetic distances are implemented. The only null models that are currently implemented are the richness and dispersal nulls. The function could be improved by tapping into any of the metrics and nulls defined in defineMetrics and defineNulls.

References

Miller, Wagner, Harmon & Ricklefs. In review. Radiating despite a lack of character: closely related, morphologically similar, co-occurring honeyeaters have diverged ecologically.

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)

#simulate trait evolution up the tree. Make 2-d trait space and find distances between
#species in that space
traits <- evolveTraits(tree)

#calculate the distances betweeen species
dists <- as.matrix(dist(traits[[2]], diag=TRUE, upper=TRUE))

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

#simulate a community data matrix with these inputs
cdm <- simulateComm(tree, richness.vector=10:25, abundances=sim.abundances)

#example trait field calculations
exampleField <- sesTraitField(trait.distance=dists, tree=tree, picante.cdm=cdm, 
	metric="naw.mpd", null="richness", randomizations=10)
# }

Run the code above in your browser using DataLab