R/HypTreeJSON.R

Defines functions HypTreeJSON

Documented in HypTreeJSON

HypTreeJSON <- function(hyp.tree, type = 'unadjusted') {
    tree <- graph.edgelist(hyp.tree@tree)
    V(tree)$names <- rownames(hyp.tree@p.vals)
    if(type == 'adjusted') {
        V(tree)$pval <- round(hyp.tree@p.vals[, 'adjp'], 5)
    } else {
        V(tree)$pval <- round(hyp.tree@p.vals[, 'unadjp'], 5)
    }
    rjson::toJSON(ListTreePval(tree))
}

Try the structSSI package in your browser

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

structSSI documentation built on May 30, 2017, 2:52 a.m.