Running examples in 'deepgmm-Ex.R' failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: deepgmm
> ### Title: Fits Deep Gaussian Mixture Models Using Stochastic EM algorithm.
> ### Aliases: deepgmm
> ### Keywords: cluster models multivariate
> 
> ### ** Examples
> 
> layers <- 2
> k <- c(3, 4) 
> r <- c(3, 2)
> it <- 50
> eps <- 0.001
> y <- scale(mtcars)
> 
> set.seed(1)
> fit <-deepgmm(y = y, layers = layers, k = k, r = r,
+                   it = it, eps = eps)
 ----------- FAILURE REPORT -------------- 
 --- failure: the condition has length > 1 ---
 --- srcref --- 
: 
 --- package (from environment) --- 
deepgmm
 --- call from context --- 
deepgmm(y = y, layers = layers, k = k, r = r, it = it, eps = eps)
 --- call from argument --- 
if (class(y) == "data.frame") y <- as.matrix(y)
 --- R stacktrace ---
where 1: deepgmm(y = y, layers = layers, k = k, r = r, it = it, eps = eps)

 --- value of length: 2 type: logical ---
[1] FALSE FALSE
 --- function from context --- 
function (y, layers, k, r, it = 250, eps = 0.001, init = "kmeans", 
    init_est = "factanal") 
{
    if (any(tolower(init) == c("kmeans", "k-means", "k"))) 
        init <- "kmeans"
    if (any(tolower(init) == c("random", "r"))) 
        init <- "random"
    if (any(tolower(init) == c("hclass", "h"))) 
        init <- "hclass"
    if (any(tolower(init_est) == c("factanal", "factana", "fact", 
        "f"))) 
        init_est <- "factanal"
    if (class(y) == "data.frame") 
        y <- as.matrix(y)
    tmp <- valid_args(Y = y, layers = layers, k = k, r = r, it = it, 
        eps = eps, init = init)
    numobs <- nrow(y)
    p <- ncol(y)
    r <- c(p, r)
    lst <- list(w = list(), H = list(), mu = list(), psi = list(), 
        psi.inv = list())
    for (i in 1:layers) {
        if (i == 1) {
            data <- y
        }
        else {
            data <- z[, 1:r[i], drop = FALSE]
        }
        s <- initial_clustering(data, k, i, init)
        for (j in 1:k[i]) {
            if ((table(s)[j]) < 2) {
                s[sample(1:numobs, 2, replace = FALSE)] <- j
            }
        }
        psi <- psi.inv <- array(0, c(k[i], r[i], r[i]))
        H <- array(0, c(k[i], r[i], r[i + 1]))
        mu <- matrix(0, r[i], k[i])
        if (init_est == "factanal") {
            i_lst <- factanal_para(data, s, k, r, i, numobs)
            lst$w[i] <- list(i_lst$w)
            lst$H[i] <- list(i_lst$H)
            lst$mu[i] <- list(i_lst$mu)
            lst$psi[i] <- list(i_lst$psi)
            lst$psi.inv[i] <- list(i_lst$psi.inv)
            z <- i_lst$z
        }
        else {
            if (init_est != "ppca") 
                stop("init_est has to be either `factanal` or `ppca`")
            i_lst <- ppca_para(data, s, k, r, i, numobs)
            lst$w[i] <- list(i_lst$w)
            lst$H[i] <- list(i_lst$H)
            lst$mu[i] <- list(i_lst$mu)
            lst$psi[i] <- list(i_lst$psi)
            lst$psi.inv[i] <- list(i_lst$psi.inv)
            z <- i_lst$z
        }
    }
    if (layers == 1) {
        out <- deep.sem.alg.1(y, numobs, p, r[2], k, lst$H, lst$psi, 
            lst$psi.inv, lst$mu, lst$w, it, eps)
    }
    if (layers == 2) {
        out <- deep.sem.alg.2(y, numobs, p, r, k, lst$H, lst$psi, 
            lst$psi.inv, lst$mu, lst$w, it, eps)
    }
    if (layers == 3) {
        out <- deep.sem.alg.3(y, numobs, p, r, k, lst$H, lst$psi, 
            lst$psi.inv, lst$mu, lst$w, it, eps)
    }
    out$lik <- out$likelihood
    output <- out[c("H", "w", "mu", "psi", "lik", "bic", "aic", 
        "clc", "icl_bic", "s", "h")]
    output <- c(output, list(k = k, r = r[-1], numobs = numobs, 
        layers = layers))
    output$call <- match.call()
    class(output) <- "dgmm"
    invisible(output)
}
<bytecode: 0x1e13a08>
<environment: namespace:deepgmm>
 --- function search by body ---
Function deepgmm in namespace deepgmm has this body.
 ----------- END OF FAILURE REPORT -------------- 
Fatal error: the condition has length > 1