R/subtree.R

`subtree` <-
function (node, tree) 
{
    edges <- numeric(0)
    newedges <- which(tree[1, ] == node)
    while (length(newedges) > 0) {
        edges <- c(edges, newedges)
        newnodes <- tree[2, newedges]
        newedges <- which(tree[1, ] %in% newnodes)
    }
    return(sort(edges))
}

Try the oncomodel package in your browser

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

oncomodel documentation built on May 1, 2019, 8:01 p.m.