1 |
m |
|
se |
|
op |
|
cov.fun |
|
SEED |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | ##---- Should be DIRECTLY executable !! ----
##-- ==> Define data, use random,
##-- or do help(data=index) for the standard data sets.
## The function is currently defined as
function (m, se = FALSE, op = 0, cov.fun = covmve, SEED = TRUE)
{
if (op == 0)
temp <- apgdis(m, se = se)$distance
if (op != 0)
temp <- out(m, cov.fun = cov.fun, plotit = FALSE, SEED = SEED)$dis
flag <- (temp != min(temp))
temp2 <- temp
temp2[!flag] <- max(temp)
flag2 <- (temp2 != min(temp2))
flag[!flag2] <- F
varvec <- NA
while (sum(flag) > 0) {
ic <- 0
chk <- NA
remi <- NA
for (i in 1:nrow(m)) {
if (flag[i]) {
ic <- ic + 1
chk[ic] <- gvar(rbind(m[!flag, ], m[i, ]))
remi[ic] <- i
}
}
sor <- order(chk)
k <- remi[sor[1]]
varvec[k] <- chk[sor[1]]
flag[k] <- F
}
varvec
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.