Learn R Programming

rdiversity (version 1.0)

chainsaw: Cut Phylogeny

Description

Cut Phylogeny

Usage

chainsaw(partition, ps, interval, depth)

Arguments

partition

proportional abundance of types in the subcommunity as a fraction of the metacommunity as a whole (in the phylogenetic case, this corresponds to the proportional abundance of terminal taxa).

ps

phy_struct() output.

interval

proportion of total tree height to be conserved (taken as a proportion from the heighest tip). Describes how far back we go in the tree, with 0 marking the date of the most recent tip, and 1 (the default) marking the most recent common ancestor. Numbers greater than 1 extend the root of the tree.

depth

object length of total tree height to be conserved.

Value

Returns an object of class phy_struct containing a new structural matrix ('@structure').and the original phylogenetic parameters ('@parameters').

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)

a <- chainsaw(partition, ps, interval = 0.9)
b <- chainsaw(partition, ps, interval = 2)
z <- chainsaw(partition, ps, interval = 0)
m <- chainsaw(partition, ps, interval = 1)

# }

Run the code above in your browser using DataLab