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 Feb. 8, 2022, 5:06 p.m.