R/distMoa.R

Defines functions distMoa

Documented in distMoa

distMoa <-
function(x, nf=NA, tol=1e-5, method = "euclidean", diag = FALSE, upper = FALSE, p = 2) {
  if (is.na(nf))
    nf <- Inf
  if (inherits(x, "moa")) {
    nfi <- x@eig > tol
    x <- moaScore(x)
  }
  if (nf > ncol(x) | nf > sum(nfi)) {
    nf <- min(ncol(x), sum(nfi))
    cat(paste("nf set to ", nf, ".\n", sep = ""))
  }
  nfi[-(1:nf)] <- FALSE
  x <- x[, nfi]
  dist(x, method = method, diag = diag, upper = upper, p = p)
}

Try the mogsa package in your browser

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

mogsa documentation built on Nov. 8, 2020, 5:41 p.m.