R/initialsna.R

initialsna = function(tree, sna.name) {
    sna.no = length(sna.name)
    sna.edge = sample(2:nrow(tree$edge), size = sna.no, replace = TRUE)
    sna.mat = cbind(1:sna.no, tree$edge[sna.edge, ])
    colnames(sna.mat) = c("sna", "sna.st.node", "sna.ed.node")
    rownames(sna.mat) = sna.name
    return(sna.mat)
} 

Try the Canopy package in your browser

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

Canopy documentation built on May 1, 2019, 7:59 p.m.