Learn R Programming

rdiversity (version 1.0)

phy_abundance: Calculate abundance of historical species

Description

Calculates the relative abundance of historical species.

Usage

phy_abundance(partition, structure_matrix)

Arguments

partition

two-dimensional matrix of mode numeric with rows as types, columns as subcommunities, and elements containing relative abundances of types in subcommunities. In the case of phylogenetic metacommunities, these are the relative abundances of terminal taxa.

structure_matrix

output$structure of phy_struct().

Examples

Run this code
# NOT RUN {
tree <- ape::rtree(n = 5)
tree$tip.label <- paste0("sp", seq_along(tree$tip.label))
partition <- cbind(a = c(1,1,1,0,0), b = c(0,1,0,1,1))
row.names(partition) <- tree$tip.label
partition <- partition / sum(partition)
ps <- phy_struct(tree, partition)
structure_matrix <- ps$structure
phy_abundance(partition, structure_matrix)

# }

Run the code above in your browser using DataLab