R/sim2dist.R

Defines functions sim2dist

Documented in sim2dist

###############################################################################
## convert similarity matrix to dist object
###############################################################################
sim2dist <- function(x, maxSim = 1){
    stopifnot(is.matrix(x))
    stopifnot(isSymmetric(x))
    stopifnot(maxSim >= max(x))
    d <- maxSim - x # from similarity to distance
    return(as.dist(d))
}

Try the RFLPtools package in your browser

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

RFLPtools documentation built on May 2, 2019, 6:08 p.m.