R/linCombDist.R

Defines functions linCombDist

Documented in linCombDist

linCombDist <- function(x, distfun1, w1, distfun2, w2, diag = FALSE, upper = FALSE){ 
    stopifnot(is.function(distfun1))
    stopifnot(is.function(distfun2))
    
    res <- w1*distfun1(x) + w2*distfun2(x)
    attributes(res) <- NULL
    attr(res, "Size") <- nrow(as.matrix(x))
    attr(res, "Labels") <- dimnames(x)[[1L]]
    attr(res, "Diag") <- diag
    attr(res, "Upper") <- upper
    attr(res, "call") <- match.call()
    class(res) <- "dist"
    res
}

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.