PD_ses: Phylogenetic diversity standardized for species richness

Description Usage Arguments Value References Examples

View source: R/PD_ses.R

Description

This function computes the standard effect size of PD by correcting for changes in species richness. The novelty of this function is its ability to utilize sparse community matrix making it possible to efficiently randomize very large community matrices spanning thousands of taxa and sites.

Usage

1
PD_ses(x, phy, model = c("tipshuffle", "rowwise", "colwise"), reps = 1000, ...)

Arguments

x

a (sparse) community matrix, i.e. an object of class matrix or Matrix.

phy

a phylogenetic tree (object of class phylo).

model

The null model for separating patterns from processes and for contrasting against alternative hypotheses. Available null models include:

  • “tipshuffle”: shuffles tip labels multiple times.

  • “rowwise”: shuffles sites (i.e., varying richness) and keeping species occurrence frequency constant.

  • “colwise”: shuffles species occurrence frequency and keeping site richness constant.

reps

Number of replications.

...

Further arguments passed to or from other methods.

Value

A data frame of results for each community or grid cell

References

Proches, S., Wilson, J.R.U. & Cowling, R.M. (2006) How much evolutionary history in a 10 x 10m plot? Proceedings of Royal Society B 273: 1143-1148.

Examples

1
2
3
4
5
6
7
8
library(ape)
library(Matrix)
tree <- read.tree(text ="((t1:1,t2:1)N2:1,(t3:1,t4:1)N3:1)N1;")
com <- sparseMatrix(c(1,3,4,1,4,5,1,2,3,4,5,6,3,4,6),
  c(1,1,1,2,2,2,3,3,3,3,3,3,4,4,4),x=1,
  dimnames = list(paste0("g", 1:6), tree$tip.label))

PD_ses(com, tree, model="rowwise")

phyloregion documentation built on May 1, 2021, 9:06 a.m.