R/bin.multiPhylo.R

Defines functions bin.multiPhylo

Documented in bin.multiPhylo

bin.multiPhylo <- function(treelist)
{
    edge.dists <- dist.multiPhylo(treelist, method="edgeset")
    edge.dists <- as.matrix(edge.dists)

    bin.id = 1
    binning = rep(NA,length(treelist))
    while(any(is.na(binning)))
    {
         # find the next unbinned tree & find all matching trees
         next.tr = min(which(is.na(binning)))
         binning[edge.dists[,next.tr] == 0] = bin.id
         bin.id = bin.id + 1
    }

    binning
}

Try the distory package in your browser

Any scripts or data that you put into this service are public.

distory documentation built on April 19, 2020, 3:56 p.m.