R/summary.vhicaimage.R

Defines functions summary.vhicaimage

Documented in summary.vhicaimage

summary.vhicaimage <- function(object, divrate=NA, p.thresh=1, ...)
{
    st <- object$stats
    ds <- object$dS
    st[lower.tri(st)] <- NA
    ds[lower.tri(ds)] <- NA
    tokeep <- c(!is.na(ds)) # should be the same as !is.na(st)
    ans <- data.frame(
        expand.grid(colnames(object$stats), rownames(object$stats))[tokeep,], 
        'p.value'= c(10^object$stats)[tokeep], 
        dS=     c(object$dS)[tokeep])
    colnames(ans)[1:2] <- c("sp1","sp2")
    rownames(ans) <- NULL
    if (!is.na(divrate)) 
        ans[,"Time(Mya)"] <- ans$dS/(2*divrate)
    return(ans[ans$'p.value' <= p.thresh,])
}

Try the vhica package in your browser

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

vhica documentation built on March 31, 2023, 10:09 p.m.