updateTreeList: internal Phylofactor function - splits the tree corresponding...

View source: R/updateTreeList.R

updateTreeListR Documentation

internal Phylofactor function - splits the tree corresponding to the split bin

Description

internal Phylofactor function - splits the tree corresponding to the split bin

Usage

updateTreeList(treeList, binList, grp, tree, skip.check = F)

Arguments

treeList

list of trees

binList

list of bins corresponding to treeList

grp

two-element list corresponding to the splitting of an bin

tree

phylo class object

skip.check

Logical whether to skip checking if we grabbed the correct tree.

Examples

library(ape)
set.seed(6)
tree <- rtree(10)
Groups <- getPhyloGroups(tree)
treeList <- list(tree)
binList <- list(1:10)
factor <- 2
grp <- getLabelledGrp(factor,tree,Groups)
grp
lapply(grp,FUN=function(g,tree){tree$tip.label[g]},tree=tree)

node=17

treeList <- updateTreeList(treeList,binList,grp,tree)
par(mfrow=c(1,3))
plot.phylo(tree,main='Original Tree',cex=2)
edgelabels('SPLIT',factor,bg='red',cex=2)

plot.phylo(treeList[[1]],main='First Bin Tree',cex=2)
plot.phylo(treeList[[2]],main='Second Bin Tree',cex=2)

reptalex/phylofactor documentation built on Feb. 28, 2024, 3:19 p.m.