phylobeta: Phylogenetic beta diversity

View source: R/phylo_beta.R

phylobeta_coreR Documentation

Phylogenetic beta diversity

Description

phylobeta_core computes efficiently for large community matrices and trees the necessary quantities used by the betapart package to compute pairwise and multiple-site phylogenetic dissimilarities.

Usage

phylobeta_core(x, phy)

phylobeta(x, phy, index.family = "sorensen")

Arguments

x

an object of class Matrix, matrix or phyloseq

phy

a phylogenetic tree (object of class phylo)

index.family

family of dissimilarity indices, partial match of "sorensen" or "jaccard".

Value

phylobeta_core returns an object of class "phylo.betapart", see phylo.betapart.core for details. This object can be called by phylo.beta.pair or phylo.beta.multi.

phylobeta returns a list with three phylogenetic dissimilarity matrices. See phylo.beta.pair for details.

Author(s)

Klaus Schliep

See Also

read.community, phylo.betapart.core, beta_core

Examples

library(ape)
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))
com

pbc <- phylobeta_core(com, tree)
pb <- phylobeta(com, tree)

darunabas/phyloregion documentation built on Oct. 27, 2024, 10:01 p.m.