R/dCov.R

Defines functions dCov

Documented in dCov

#' Title
#'
#' @param x
#' @param y
#' @param alpha
#'
#' @return
#' @export
#'
#' @examples
dCov <- function(x, y, alpha) {
  if (missing(alpha))
    alpha <-1
  n <- nrow(as.matrix(x))
  if (length(y)!=n)
    stop( "x and y must be the same size")
  x <- as.matrix(dist(as.matrix(x),diag=TRUE, upper=TRUE))
  y <- as.matrix(dist(as.matrix(y),diag=TRUE, upper=TRUE))
  y[which(y!=0)]=1
  return(dcov(x,y, alpha))
}

Try the GiniDistance package in your browser

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

GiniDistance documentation built on Sept. 2, 2022, 9:06 a.m.