Running examples in ‘robCompositions-Ex.R’ failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: compareMahal
> ### Title: Compares Mahalanobis distances from two approaches
> ### Aliases: compareMahal getEstimates print.estimates plot.estimates
> ###   plot.mahal
> 
> ### ** Examples
> 
> 
> data(arcticLake)
> # generate some zeros
> arcticLake[1:10, 1] <- 0
> arcticLake[11:20, 2] <- 0
> m <- compareMahal(arcticLake)
Warning in (as.numeric(unlist(xilr)) - covs$center)/sqrt(covs$cov) :
  Recycling array of length 1 in vector-array arithmetic is deprecated.
  Use c() or as.vector() instead.

Warning in (as.numeric(unlist(xilr)) - covs$center)/sqrt(covs$cov) :
  Recycling array of length 1 in vector-array arithmetic is deprecated.
  Use c() or as.vector() instead.

 ----------- FAILURE REPORT -------------- 
 --- failure: the condition has length > 1 ---
 --- srcref --- 
: 
 --- package (from environment) --- 
robCompositions
 --- call from context --- 
zeroOut(x[, ind, drop = FALSE], imp)
 --- call from argument --- 
if (class(xi) == "matrix") xi <- data.frame(xi)
 --- R stacktrace ---
where 1: zeroOut(x[, ind, drop = FALSE], imp)
where 2: compareMahal(arcticLake)

 --- value of length: 2 type: logical ---
[1]  TRUE FALSE
 --- function from context --- 
function (x, impute = "knn") 
{
    rownames(x) <- 1:nrow(x)
    ind <- 1:ncol(x)
    D <- ncol(x)
    if (impute %in% c("impKNNa", "knna", "KNNa")) {
        xi <- impKNNa(x)$xImp
    }
    else if (impute %in% c("knn", "KNN", "kNN")) {
        xi <- kNN(x, imp_var = FALSE)
    }
    else if (impute %in% c("IRMI", "irmi", "Irmi")) {
        xi <- impCoda(x, init = "geometricmean")$xImp
    }
    else {
        stop("wrong method for imputation specified")
    }
    x <- cbind(x, ID = 1:nrow(x))
    xi <- cbind(xi, ID = 1:nrow(x))
    if (class(xi) == "matrix") 
        xi <- data.frame(xi)
    w <- is.na(x[, ind])
    s <- apply(w, 1, paste, collapse = ":")
    xs <- split(xi, s)
    getSortIndex <- function(x, s) {
        xs <- split(x, s)
        lapply(xs, function(x) {
            is.na(x[1, ])
        })
    }
    si <- getSortIndex(x[, ind], s)
    zneworder <- xs
    mah <- pval <- mahcorr <- IDlist <- list()
    for (i in 1:length(xs)) {
        index <- names(xs[i])
        index <- as.logical(strsplit(index, ":")[[1]])
        sortedxs <- xs[[i]]
        wt <- which(index)
        wf <- which(!index)
        sortedxs <- sortedxs[, c(wt, wf)]
        zneworder <- pivotCoord(sortedxs)
        zcovs <- robustbase::covMcd(zneworder)
        if (length(wf) == 2) {
            p <- ncol(zneworder)
            zscore <- (zneworder[, p] - zcovs$center[p])/sqrt(zcovs$cov[p, 
                p])
            mah[[i]] <- abs(zscore)
            pval[[i]] <- pnorm(mah[[i]])
            mahcorr[[i]] <- mah[[i]]/qnorm(0.975)
            names(mahcorr[[i]]) <- names(pval[[i]]) <- names(mah[[i]]) <- rownames(xs[[i]])
        }
        else if (length(wf) > 2) {
            noneff <- c((length(wt) + 1):(D - 1))
            mah[[i]] <- sqrt(as.numeric(mahalanobis(zneworder[, 
                noneff], center = zcovs$center[noneff], cov = zcovs$cov[noneff, 
                noneff])))
            pval[[i]] <- pchisq((mah[[i]])^2, length(wf))
            mahcorr[[i]] <- mah[[i]]/sqrt(qchisq(0.975, ncol(zneworder[, 
                noneff])))
            names(mahcorr[[i]]) <- names(pval[[i]]) <- names(mah[[i]]) <- rownames(xs[[i]])
        }
        else {
            mah[[i]] <- NA
            pval[[i]] <- NA
            mahcorr[[i]] <- NA
        }
        IDlist[[i]] <- xs[[i]][ncol(xs[[i]])]
    }
    nam <- names(unlist(mahcorr))
    df <- data.frame(mah = as.numeric(unlist(mah)), pval = as.numeric(unlist(pval)), 
        mahcorr = as.numeric(unlist(mahcorr)), ID = nam)
    df <- merge(x, df, by = "ID")
    df <- cbind(df, outlier = df$mahcorr > 1)
    return(df)
}
<bytecode: 0x55dc6082f4b0>
<environment: namespace:robCompositions>
 --- function search by body ---
Function zeroOut in namespace robCompositions has this body.
 ----------- END OF FAILURE REPORT -------------- 
Fatal error: the condition has length > 1